Definition at line 213 of file test_device_server.py.
◆ _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
231
232
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: