#!/usr/bin/env python # vim: ts=8 sts=4 sw=4 expandtab # Author: Douglas Clowes (dcl@ansto.gov.au) 2014-06-24 # import test_sics class Wombat(test_sics.Baker): def test_wombat_000_000_motors(self): if test_sics.instrument_name != "wombat": raise unittest.SkipTest("Instrument is not Wombat") missing = [] for m in ["mphi", "mchi", "mom", "mtth", "som", "stth"]: if m not in test_sics.motors: missing.append(m) if test_sics.instrument_name == "wombat" and len(missing) > 0: raise Exception("Missing motors:" + repr(missing)) def test_wombat_001_000_newfile(self): def cb(result, *args, **kw): self.assertTrue(result[0] == "OK") return result d = self.send_command("newfile HISTOGRAM_XY scratch") d.addCallback(cb) return d def test_wombat_001_001_save(self): def cb(result, *args, **kw): self.assertTrue("OK" in result) return result d = self.send_command("save") d.addCallback(cb) return d