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_device_server.TestConfigLoader Class Reference
Inheritance diagram for microscope.testsuite.test_device_server.TestConfigLoader:

Public Member Functions

 test_py_file_extension (self)
 
 test_cfg_file_extension (self)
 
 test_no_file_extension (self)
 

Protected Member Functions

 _test_load_source (self, filename)
 

Detailed Description

Definition at line 213 of file test_device_server.py.

Member Function Documentation

◆ _test_load_source()

microscope.testsuite.test_device_server.TestConfigLoader._test_load_source ( self,
filename )
protected

Definition at line 214 of file test_device_server.py.

214 def _test_load_source(self, filename):
215 file_contents = "DEVICES = [1,2,3]"
216 with tempfile.TemporaryDirectory() as dirpath:
217 filepath = os.path.join(dirpath, filename)
218 with open(filepath, "w") as fh:
219 fh.write(file_contents)
220
222 self.assertEqual(module.DEVICES, [1, 2, 3])
223

◆ test_cfg_file_extension()

microscope.testsuite.test_device_server.TestConfigLoader.test_cfg_file_extension ( self)
Reading of config file does not require .py file extension

Definition at line 228 of file test_device_server.py.

228 def test_cfg_file_extension(self):
229 """Reading of config file does not require .py file extension"""
230 # Test for issue #151. Many importlib functions assume that
231 # the file has importlib.machinery.SOURCE_SUFFIXES extension
232 # so we need a bit of extra work to work with none or .cfg.
233 self._test_load_source("foobar.cfg")
234

◆ test_no_file_extension()

microscope.testsuite.test_device_server.TestConfigLoader.test_no_file_extension ( self)
Reading of config file does not require file extension

Definition at line 235 of file test_device_server.py.

235 def test_no_file_extension(self):
236 """Reading of config file does not require file extension"""
237 self._test_load_source("foobar")
238
239

◆ test_py_file_extension()

microscope.testsuite.test_device_server.TestConfigLoader.test_py_file_extension ( self)
Reading of config file module-like works

Definition at line 224 of file test_device_server.py.

224 def test_py_file_extension(self):
225 """Reading of config file module-like works"""
226 self._test_load_source("foobar.py")
227

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