BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
microscope.testsuite.test_devices.DeviceTests Class Reference
Inheritance diagram for microscope.testsuite.test_devices.DeviceTests:
microscope.testsuite.test_devices.CameraTests microscope.testsuite.test_devices.ControllerTests microscope.testsuite.test_devices.DSPTests microscope.testsuite.test_devices.DeformableMirrorTests microscope.testsuite.test_devices.FilterWheelTests microscope.testsuite.test_devices.LightSourceTests microscope.testsuite.test_devices.SLMTests microscope.testsuite.test_devices.TestDummyCamera microscope.testsuite.test_devices.TestDummyController microscope.testsuite.test_devices.TestDummyDSP microscope.testsuite.test_devices.TestDummyDeformableMirror microscope.testsuite.test_devices.TestOnePositionFilterWheel microscope.testsuite.test_devices.TestSixPositionFilterWheel microscope.testsuite.test_devices.TestCoboltLaser microscope.testsuite.test_devices.TestCoherentSapphireLaser microscope.testsuite.test_devices.TestDummyLightSource microscope.testsuite.test_devices.TestOmicronDeepstarLaser microscope.testsuite.test_devices.TestDummySLM

Public Member Functions

 test_on_and_off (self)
 
 test_enable_and_disable (self)
 
 test_enable_enabled (self)
 
 test_disable_disabled (self)
 

Detailed Description

Tests cases for all devices.

This collection of tests cover the very basic behaviour of
devices,stuff like initialising and enabling the device.  Classes
of tests specific to each device type should subclass from it.

Subclasses must define a `device` property during `setUp`, an
instance of :class:`Device`.

Definition at line 96 of file test_devices.py.

Member Function Documentation

◆ test_disable_disabled()

microscope.testsuite.test_devices.DeviceTests.test_disable_disabled ( self)
Handles disabling of an already disabled device.

Test disabling twice, both before and after enabling it for
the first time.

Definition at line 134 of file test_devices.py.

134 def test_disable_disabled(self):
135 """Handles disabling of an already disabled device.
136
137 Test disabling twice, both before and after enabling it for
138 the first time.
139 """
140 self.device.initialize()
141 self.device.disable()
142 self.device.disable()
143 self.device.enable()
144 self.assertTrue(self.device.enabled)
145 self.device.disable()
146 self.device.disable()
147
148

◆ test_enable_and_disable()

microscope.testsuite.test_devices.DeviceTests.test_enable_and_disable ( self)

Definition at line 113 of file test_devices.py.

113 def test_enable_and_disable(self):
114 # TODO: we need to define what happens when enable is called
115 # and device has not been initialised. See issue #69
116 self.device.initialize()
117 self.device.enable()
118 self.assertTrue(self.device.enabled)
119 # We don't check if it is disabled after shutdown because
120 # some devices can't be turned off.
121 # TODO: add a `has_disabled_state` to the fake so we can
122 # query whether we can check about being disabled.
123 self.device.disable()
124 self.device.shutdown()
125

◆ test_enable_enabled()

microscope.testsuite.test_devices.DeviceTests.test_enable_enabled ( self)
Handles enabling of an already enabled device

Definition at line 126 of file test_devices.py.

126 def test_enable_enabled(self):
127 """Handles enabling of an already enabled device"""
128 self.device.initialize()
129 self.device.enable()
130 self.assertTrue(self.device.enabled)
131 self.device.enable()
132 self.assertTrue(self.device.enabled)
133

◆ test_on_and_off()

microscope.testsuite.test_devices.DeviceTests.test_on_and_off ( self)
Device can be turned on and off

Definition at line 108 of file test_devices.py.

108 def test_on_and_off(self):
109 """Device can be turned on and off"""
110 self.device.initialize()
111 self.device.shutdown()
112

The documentation for this class was generated from the following file: