=== modified file 'mandos-ctl' --- mandos-ctl 2019-03-04 18:52:48 +0000 +++ mandos-ctl 2019-03-04 19:03:10 +0000 @@ -795,6 +795,10 @@ self.calls.append(("Get", (interface, property, dbus_interface))) return self.attributes[property] + def Approve(self, approve, dbus_interface): + testcase.assertEqual(dbus_interface, client_interface) + self.calls.append(("Approve", (approve, + dbus_interface))) def __getitem__(self, key): return self.attributes[key] def __setitem__(self, key, value): @@ -967,7 +971,6 @@ else: self.assertIsNotNone(e.exception.code) - class TestRemoveCmd(TestCmd): def test_remove(self): class MockMandos(object): @@ -982,6 +985,17 @@ [("RemoveClient", (self.client.__dbus_object_path__,))]) +class TestApproveCmd(TestCmd): + def test_approve(self): + ApproveCmd().run(None, [self.client]) + self.assertListEqual(self.client.calls, + [("Approve", (True, client_interface))]) +class TestDenyCmd(TestCmd): + def test_approve(self): + DenyCmd().run(None, [self.client]) + self.assertListEqual(self.client.calls, + [("Approve", (False, client_interface))]) + def should_only_run_tests():