To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit b92f9a81 authored by mikolajr's avatar mikolajr
Browse files

fix style

parent de5bf587
Pipeline #53114 passed with stages
in 2 minutes and 58 seconds
......@@ -37,14 +37,14 @@ class NewportSMC100PPSerialCommunicationConfig(SerialCommunicationConfig):
baudrate: int = 57600
#: Heinzinger does not use parity
parity: Union[str, SerialCommunicationParity,] = SerialCommunicationParity.NONE
parity: Union[str, SerialCommunicationParity] = SerialCommunicationParity.NONE
#: Heinzinger uses one stop bit
stopbits: Union[int, SerialCommunicationStopbits,] = SerialCommunicationStopbits.ONE
stopbits: Union[int, SerialCommunicationStopbits] = SerialCommunicationStopbits.ONE
#: One byte is eight bits long
bytesize: Union[
int, SerialCommunicationBytesize,
int, SerialCommunicationBytesize
] = SerialCommunicationBytesize.EIGHTBITS
#: The terminator is CR/LF
......@@ -162,7 +162,7 @@ class NewportSMC100PPSerialCommunication(SerialCommunication):
raise NewportSerialCommunicationError(message)
else:
logging.debug(f"Newport com: {answer}")
return answer[len(prefix) :].strip()
return answer[len(prefix):].strip()
def _check_for_error_unsafe(self, add: int) -> None:
"""
......@@ -265,7 +265,7 @@ class NewportSMC100PPSerialCommunication(SerialCommunication):
logging.error(message)
raise NewportSerialCommunicationError(message)
else:
answer.append(line[len(prefix) :])
answer.append(line[len(prefix):])
finally:
self._check_for_error_unsafe(add)
......
......@@ -60,7 +60,7 @@ class _RTO1024ConfigDefaultsBase(_VisaDeviceConfigDefaultsBase):
is respected for long operations such as storing waveforms.
"""
wait_sec_short_pause: Number = 0.1
"""Time for short wait periods, in seconds (depends on both device and
"""Time for short wait periods, in seconds (depends on both device and
network/connection)."""
wait_sec_enable_history: Number = 1
"""Time to wait after enabling history, in seconds."""
......
......@@ -50,7 +50,10 @@ def test_dev_config(dev_config):
@pytest.mark.parametrize(
"wrong_config_dict", [{"polling_interval": 0}, {"polling_interval": -1},],
"wrong_config_dict", [
{"polling_interval": 0},
{"polling_interval": -1},
],
)
def test_dev_config_invalid(wrong_config_dict):
with pytest.raises(ValueError):
......
......@@ -295,7 +295,8 @@ def test_save_configuration(testdev: RTO1024):
assert testdev.com.get_written() == "*SAV 49"
assert (
testdev.com.get_written()
== "MMEMory:STOR:STAT 49,'C:\\Data\\DavidGraber\\01_settings\\test_configuration"
==
"MMEMory:STOR:STAT 49,'C:\\Data\\DavidGraber\\01_settings\\test_configuration"
".dfl'"
)
......@@ -304,7 +305,8 @@ def test_load_configuration(testdev: RTO1024):
testdev.load_configuration("test_configuration")
assert (
testdev.com.get_written()
== "MMEMory:LOAD:STAT 41,'C:\\Data\\DavidGraber\\01_settings\\test_configuration"
==
"MMEMory:LOAD:STAT 41,'C:\\Data\\DavidGraber\\01_settings\\test_configuration"
".dfl'"
)
assert testdev.com.get_written() == "*RCL 41"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment