def test_register_and_unregister_action(self): def mock_action(): return True t1 = self.engine.register(mock_action) action_key, mod_name, _ = service.action_key(__name__, 'mock_action') self.assertEqual(t1.key, action_key) self.engine.unregister(action_key) self.assertIsNone(self.engine.get_action(action_key))
def test_register_and_unregister_action(self): def mock_action(): return True t1 = self.engine.register(mock_action) action_key = service.action_key(__name__, 'mock_action') self.assertEqual(t1.key, action_key) self.engine.unregister(action_key) self.assertIsNone(self.engine.get_action(action_key))
def test_task_key(self): self.assertTrue(service.action_key('a', 'f'), 'a.f') self.assertTrue(service.action_key('b.a', 'f'), 'a.f') self.assertTrue(service.action_key('c.b.a', 'f'), 'a.f') self.assertTrue(service.action_key('a', 'f2'), 'a.f2')