diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-13 18:03:14 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-13 18:03:14 -0400 |
commit | 83e0ff0b516d18191ae8fb9b89ab35d84642662e (patch) | |
tree | 63b4e1079e762da4cacc22d992f3c28516194b81 | |
parent | f5c9611d2d277a7e456c8f952d7f6a78ca891f4a (diff) | |
download | qolab-83e0ff0b516d18191ae8fb9b89ab35d84642662e.tar.gz qolab-83e0ff0b516d18191ae8fb9b89ab35d84642662e.zip |
black formatter
-rw-r--r-- | tests/test_response2numStr.py | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/tests/test_response2numStr.py b/tests/test_response2numStr.py index bd41983..9bb4e8b 100644 --- a/tests/test_response2numStr.py +++ b/tests/test_response2numStr.py @@ -1,20 +1,59 @@ import pytest from qolab.hardware.scpi import response2numStr + def test_separator_and_unit(): - assert response2numStr('TDIV 2.00E-08S', firstSeparator=' ', unit='Z') == ('TDIV', '2.00E-08S', None) # incorrect unit was specified - assert response2numStr('TDIV 2.00E-08S', firstSeparator=' ', unit='S') == ('TDIV', '2.00E-08', 'S') - assert response2numStr('TDIV,2.00E-08S', firstSeparator=',', unit='S') == ('TDIV', '2.00E-08', 'S') + assert response2numStr("TDIV 2.00E-08S", firstSeparator=" ", unit="Z") == ( + "TDIV", + "2.00E-08S", + None, + ) # incorrect unit was specified + assert response2numStr("TDIV 2.00E-08S", firstSeparator=" ", unit="S") == ( + "TDIV", + "2.00E-08", + "S", + ) + assert response2numStr("TDIV,2.00E-08S", firstSeparator=",", unit="S") == ( + "TDIV", + "2.00E-08", + "S", + ) + def test_separator_and_empty_unit(): - assert response2numStr('TDIV,2.00E-08', firstSeparator=',', unit=None) == ('TDIV', '2.00E-08', None) - assert response2numStr('TDIV,2.00E-08', firstSeparator=',', unit='') == ('TDIV', '2.00E-08', '') - + assert response2numStr("TDIV,2.00E-08", firstSeparator=",", unit=None) == ( + "TDIV", + "2.00E-08", + None, + ) + assert response2numStr("TDIV,2.00E-08", firstSeparator=",", unit="") == ( + "TDIV", + "2.00E-08", + "", + ) + + def test_no_separator_with_unit(): - assert response2numStr('2.00E-08S', firstSeparator=None, unit='S') == (None, '2.00E-08', 'S') - assert response2numStr('2.00E-08S', firstSeparator='', unit='S') == (None, '2.00E-08', 'S') - + assert response2numStr("2.00E-08S", firstSeparator=None, unit="S") == ( + None, + "2.00E-08", + "S", + ) + assert response2numStr("2.00E-08S", firstSeparator="", unit="S") == ( + None, + "2.00E-08", + "S", + ) + + def test_no_separator_and_no_unit(): - assert response2numStr('2.00E-08', firstSeparator=None, unit=None) == (None, '2.00E-08', None) - assert response2numStr('2.00E-08', firstSeparator='', unit='') == (None, '2.00E-08', '') - + assert response2numStr("2.00E-08", firstSeparator=None, unit=None) == ( + None, + "2.00E-08", + None, + ) + assert response2numStr("2.00E-08", firstSeparator="", unit="") == ( + None, + "2.00E-08", + "", + ) |