diff options
Diffstat (limited to 'tests/probetests.py')
-rw-r--r-- | tests/probetests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/probetests.py b/tests/probetests.py index 8321e19..67132ff 100644 --- a/tests/probetests.py +++ b/tests/probetests.py @@ -223,11 +223,13 @@ class ProbeTest(unittest.TestCase): del self.activity def test_ping(self): + print "test_ping" #Test ping() res = self.probe.ping() assert res == "alive", "Probe should be alive" def test_action(self): + print "test_action" global message_box action = MockAddon() action.i, action.s = (5,"woot") @@ -271,6 +273,7 @@ class ProbeTest(unittest.TestCase): assert message_box == "Test", "undo should not have happened again" def test_events(self): + print "test_events" global message_box global event_box @@ -319,6 +322,7 @@ class ProbeManagerTest(unittest.TestCase): self._registered_actions = {} def test_register_probe(self): + print "test_register_probe" assert len(self.probeManager.get_registered_probes_list()) == 0 self.probeManager.register_probe("act1", "unique_id_1") @@ -334,6 +338,7 @@ class ProbeManagerTest(unittest.TestCase): assert self.probeManager.get_registered_probes_list("act2")[0][0] == "unique_id_2" def test_register_multiple_probes(self): + print "test_register_multiple_probes" assert len(self.probeManager.get_registered_probes_list()) == 0 self.probeManager.register_probe("act1", "unique_id_1") @@ -344,6 +349,7 @@ class ProbeManagerTest(unittest.TestCase): assert self.probeManager.get_registered_probes_list("act1")[1][0] == "unique_id_2" def test_unregister_probe(self): + print "test_unregister_probe" assert len(self.probeManager.get_registered_probes_list()) == 0 self.probeManager.register_probe("act1", "unique_id_1") self.probeManager.register_probe("act1","unique_id_2") @@ -360,6 +366,7 @@ class ProbeManagerTest(unittest.TestCase): self._registered_actions[action_name] = action_address def test_actions(self): + print "test_actions" self.probeManager.register_probe("act1", "unique_id_1") self.probeManager.register_probe("act2", "unique_id_2") act1 = self.probeManager.get_registered_probes_list("act1")[0][1] @@ -393,6 +400,7 @@ class ProbeManagerTest(unittest.TestCase): assert act1.MockAction is None, "Action should be uninstalled" def test_events(self): + print "test_events" self.probeManager.register_probe("act1", "unique_id_1") self.probeManager.register_probe("act2", "unique_id_2") act1 = self.probeManager.get_registered_probes_list("act1")[0][1] @@ -425,6 +433,10 @@ class ProbeManagerTest(unittest.TestCase): class ProbeProxyTest(unittest.TestCase): def setUp(self): + #Set a default dbus mainloop + m = DBusGMainLoop(set_as_default=True) + dbus.set_default_main_loop(m) + dbus.SessionBus = MockSessionBus self.mockObj = MockProxyObject("unittest.TestCase", "/tutorius/Probe/unique_id_1") @@ -437,6 +449,7 @@ class ProbeProxyTest(unittest.TestCase): MockProxyObject._MockProxyObjects = {} def test_Alive(self): + print "test_Alive" self.mockObj.MockRet["ping"] = "alive" assert self.probeProxy.isAlive() == True, "Alive should return True" @@ -447,6 +460,7 @@ class ProbeProxyTest(unittest.TestCase): self._registered_actions[action_name] = action_address def test_actions(self): + print "test_Actions" action = MockAddon() action.i, action.s = 5, "action" action2 = MockAddon() @@ -478,6 +492,7 @@ class ProbeProxyTest(unittest.TestCase): assert self.mockObj.MockCall["uninstall"]["args"][0] == address, "1 argument, the action address" def test_events(self): + print "test_events" event = MockAddon() event.i, event.s = 5, "event" event2 = MockAddon() |