Skip to content

Commit

Permalink
Merge pull request #936 from dkriegner/fix_mks937b
Browse files Browse the repository at this point in the history
fix MKS937B check_set_errors functions and improve tests
  • Loading branch information
BenediktBurger committed Jun 28, 2023
2 parents 68f5487 + 84c2746 commit de55c6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pymeasure/instruments/mksinst/mks937b.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ def check_set_errors(self):
reply = self._re_response.search(ret)
if reply:
if reply.group('ack') == 'ACK':
return
self._check_extra_termination()
return []
# no valid acknowledgement message found
raise ValueError(f"invalid reply '{ret}' found in check_errors")

Expand Down
16 changes: 13 additions & 3 deletions tests/instruments/mksinst/test_mks937b.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,18 @@ def test_ion_gauge_status_invalid_channel():
inst.ch_2.ion_gauge_status


def test_unit():
"""Verify the communication of the voltage getter."""
def test_unit_setter():
"""Verify the communication of the unit setter."""
with expected_protocol(
MKS937B,
[("@253U!TORR", "@253ACKTORR"),
(None, b"FF")],
) as inst:
inst.unit = "Torr"


def test_unit_getter():
"""Verify the communication of the unit getter."""
with expected_protocol(
MKS937B,
[("@253U?", "@253ACKTORR"),
Expand All @@ -68,7 +78,7 @@ def test_unit():


def test_power_enabled():
"""Verify the communication of the voltage getter."""
"""Verify the communication of the channel power getter."""
with expected_protocol(
MKS937B,
[("@253CP1?", "@253ACKON"),
Expand Down

0 comments on commit de55c6e

Please sign in to comment.