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): ...@@ -37,14 +37,14 @@ class NewportSMC100PPSerialCommunicationConfig(SerialCommunicationConfig):
baudrate: int = 57600 baudrate: int = 57600
#: Heinzinger does not use parity #: Heinzinger does not use parity
parity: Union[str, SerialCommunicationParity,] = SerialCommunicationParity.NONE parity: Union[str, SerialCommunicationParity] = SerialCommunicationParity.NONE
#: Heinzinger uses one stop bit #: Heinzinger uses one stop bit
stopbits: Union[int, SerialCommunicationStopbits,] = SerialCommunicationStopbits.ONE stopbits: Union[int, SerialCommunicationStopbits] = SerialCommunicationStopbits.ONE
#: One byte is eight bits long #: One byte is eight bits long
bytesize: Union[ bytesize: Union[
int, SerialCommunicationBytesize, int, SerialCommunicationBytesize
] = SerialCommunicationBytesize.EIGHTBITS ] = SerialCommunicationBytesize.EIGHTBITS
#: The terminator is CR/LF #: The terminator is CR/LF
...@@ -162,7 +162,7 @@ class NewportSMC100PPSerialCommunication(SerialCommunication): ...@@ -162,7 +162,7 @@ class NewportSMC100PPSerialCommunication(SerialCommunication):
raise NewportSerialCommunicationError(message) raise NewportSerialCommunicationError(message)
else: else:
logging.debug(f"Newport com: {answer}") 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: def _check_for_error_unsafe(self, add: int) -> None:
""" """
...@@ -265,7 +265,7 @@ class NewportSMC100PPSerialCommunication(SerialCommunication): ...@@ -265,7 +265,7 @@ class NewportSMC100PPSerialCommunication(SerialCommunication):
logging.error(message) logging.error(message)
raise NewportSerialCommunicationError(message) raise NewportSerialCommunicationError(message)
else: else:
answer.append(line[len(prefix) :]) answer.append(line[len(prefix):])
finally: finally:
self._check_for_error_unsafe(add) self._check_for_error_unsafe(add)
......
...@@ -60,7 +60,7 @@ class _RTO1024ConfigDefaultsBase(_VisaDeviceConfigDefaultsBase): ...@@ -60,7 +60,7 @@ class _RTO1024ConfigDefaultsBase(_VisaDeviceConfigDefaultsBase):
is respected for long operations such as storing waveforms. is respected for long operations such as storing waveforms.
""" """
wait_sec_short_pause: Number = 0.1 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).""" network/connection)."""
wait_sec_enable_history: Number = 1 wait_sec_enable_history: Number = 1
"""Time to wait after enabling history, in seconds.""" """Time to wait after enabling history, in seconds."""
......
...@@ -50,7 +50,10 @@ def test_dev_config(dev_config): ...@@ -50,7 +50,10 @@ def test_dev_config(dev_config):
@pytest.mark.parametrize( @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): def test_dev_config_invalid(wrong_config_dict):
with pytest.raises(ValueError): with pytest.raises(ValueError):
......
...@@ -295,7 +295,8 @@ def test_save_configuration(testdev: RTO1024): ...@@ -295,7 +295,8 @@ def test_save_configuration(testdev: RTO1024):
assert testdev.com.get_written() == "*SAV 49" assert testdev.com.get_written() == "*SAV 49"
assert ( assert (
testdev.com.get_written() 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'" ".dfl'"
) )
...@@ -304,7 +305,8 @@ def test_load_configuration(testdev: RTO1024): ...@@ -304,7 +305,8 @@ def test_load_configuration(testdev: RTO1024):
testdev.load_configuration("test_configuration") testdev.load_configuration("test_configuration")
assert ( assert (
testdev.com.get_written() 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'" ".dfl'"
) )
assert testdev.com.get_written() == "*RCL 41" assert testdev.com.get_written() == "*RCL 41"
......
Supports Markdown
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