Update integration tests for SCPI improvements

libraVNA.cmd() no longer expects blank line responses.  By default,
it checks status after each command to match the previous behavior.
Check can be disabled by optional cmd() parameter for handling expected
failure cases.

Commands such as *WAI may take longer than anything previously.  Make
it possible to override the default time-out in cmd() and query().

Change poll loops in TestCalibration and TestVNASweep to *WAI calls.
This commit is contained in:
Scott Guthridge 2024-04-18 00:48:44 -07:00
parent 3be48bddeb
commit 95e59769fd
4 changed files with 77 additions and 44 deletions

View file

@ -4,11 +4,9 @@ import time
class TestVNASweep(TestBase):
def waitSweepTimeout(self, timeout = 1):
self.assertEqual(self.vna.query(":VNA:ACQ:FIN?"), "FALSE")
stoptime = time.time() + timeout
while self.vna.query(":VNA:ACQ:FIN?") == "FALSE":
if time.time() > stoptime:
raise AssertionError("Sweep timed out")
self.vna.cmd("*WAI", timeout=timeout)
self.assertEqual(self.vna.query(":VNA:ACQ:FIN?"), "TRUE")
def test_sweep_frequency(self):
self.vna.cmd(":DEV:MODE VNA")
self.vna.cmd(":VNA:SWEEP FREQUENCY")