def setUpClass(cls): cls.sem_int = xt_client.SEM(**CONFIG_SEM_XT) cls.sem_ext = semcomedi.SEMComedi(**CONFIG_SEM_EXT) for child in cls.sem_ext.children.value: if child.name == CONFIG_SCANNER_EXT["name"]: cls.ebeam_ext = child elif child.name == CONFIG_SED_EXT["name"]: cls.sed_ext = child for child in cls.sem_int.children.value: if child.name == CONFIG_SCANNER["name"]: cls.ebeam_int = child if child.name == CONFIG_DETECTOR["name"]: cls.sed_int = child det_kwargs = dict(name="test_detector", role="detector", dependencies={"external": cls.sed_ext}) cls.scanner = scanner.CompositedScanner( name="test_scanner", role="e-beam", dependencies={ "external": cls.ebeam_ext, "internal": cls.ebeam_int }, children={"detector": det_kwargs}, ) cls.detector = next(iter(cls.scanner.children.value))
def setUpClass(cls): cls.microscope = xt_client.SEM(**CONFIG_SEM) for child in cls.microscope.children.value: if child.name == CONFIG_SCANNER["name"]: cls.scanner = child elif child.name == CONFIG_FOCUS["name"]: cls.efocus = child elif child.name == CONFIG_STAGE["name"]: cls.stage = child
def setUpClass(cls): # Accept three values for TEST_NOHW # * TEST_NOHW = 1: not connected to anything => skip most of the tests # * TEST_NOHW = sim: xtadapter/server_sim.py running on localhost # * TEST_NOHW = 0 (or anything else): connected to the real hardware TEST_NOHW = os.environ.get("TEST_NOHW", "0") # Default to Hw testing if TEST_NOHW is True: raise unittest.SkipTest("No hardware available.") if TEST_NOHW == "sim": CONFIG_FIB_SEM["address"] = "PYRO:Microscope@localhost:4242" cls.microscope = xt_client.SEM(**CONFIG_FIB_SEM) for child in cls.microscope.children.value: if child.name == CONFIG_FIB_SCANNER["name"]: cls.fib_scanner = child elif child.name == CONFIG_DETECTOR["name"]: cls.detector = child cls.FIB_stream = stream.FIBStream("test FIB", cls.detector, cls.detector.data, cls.fib_scanner)