/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-ctl

  • Committer: Teddy Hogeborn
  • Date: 2019-03-04 18:43:22 UTC
  • Revision ID: teddy@recompile.se-20190304184322-6tumlykqh57t5nvs
mandos-ctl: Add test for RemoveCmd

* mandos-ctl (TestRemoveCmd): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
970
970
            self.assertIsNotNone(e.exception.code)
971
971
 
972
972
 
 
973
class TestRemoveCmd(TestCmd):
 
974
    def test_remove(self):
 
975
        client = self.clients["foo"]
 
976
        class MockMandos(object):
 
977
            def __init__(self):
 
978
                self.calls = []
 
979
            def RemoveClient(self, dbus_path):
 
980
                self.calls.append(("RemoveClient", (dbus_path,)))
 
981
        mandos = MockMandos()
 
982
        RemoveCmd().run(mandos, [client])
 
983
        self.assertEqual(len(mandos.calls), 1)
 
984
        self.assertListEqual(mandos.calls,
 
985
                             [("RemoveClient",
 
986
                               (client.__dbus_object_path__,))])
 
987
 
 
988
 
973
989
 
974
990
def should_only_run_tests():
975
991
    parser = argparse.ArgumentParser(add_help=False)