def test_start_stop(self): local_controller = ExportsController() exporter = MockExporter() local_controller.register_exporter(exporter) local_controller.start() self.assertTrue(exporter.is_running) local_controller.stop() self.assertFalse(exporter.is_running)
def test_initialize_exports(self): local_controller = ExportsController() exporter = MockExporter() instance = MockClass() local_controller.register_exporter(exporter) local_controller.register_object(instance) local_controller._initialize_exports() self.assertEqual(exporter.exported_methods[0].method,\ instance.ExportableMethod) self.assertEqual(exporter.exported_methods[0].args[0],\ "method_param1") self.assertEqual(exporter.exported_methods[0].kwargs['kword'],\ "method_param2") self.assertEqual(exporter.exported_signals[0].method,\ instance.ExportableSignal) self.assertEqual(exporter.exported_signals[0].args[0],\ "signal_param1") self.assertEqual(exporter.exported_signals[0].kwargs['kword'],\ "signal_param2")
def setUpClass(cls): cls._controller = ExportsController()