def test_update_filter(self): event_handler = unittest.mock.Mock() cockpit.events.subscribe('filter change', event_handler) try: camera = cockpit.handlers.camera.CameraHandler(**self.args) camera.updateFilter('test-dye', 512.0) finally: cockpit.events.unsubscribe('filter change', event_handler) event_handler.assert_called_once() self.assertEqual(camera.dye, 'test-dye') self.assertEqual(camera.wavelength, 512.0)
def test_descriptive_name(self): camera = cockpit.handlers.camera.CameraHandler(**self.args) camera.updateFilter('Test-Dye', 512.0) self.assertEqual(camera.descriptiveName, self.args['name'] + ' (Test-Dye)')