/mandos/release

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

« back to all changes in this revision

Viewing changes to mandos-ctl

  • Committer: Teddy Hogeborn
  • Date: 2019-03-04 20:50:40 UTC
  • mto: (237.7.594 trunk)
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190304205040-c0ecwnigjedch1j9
mandos-ctl: Add test for EnableCmd and DisableCmd

* mandos-ctl (TestEnableCmd, TestDisableCmd): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
990
990
            self.assertIn(("Approve", (False, client_interface)),
991
991
                          client.calls)
992
992
 
 
993
class TestEnableCmd(TestCmd):
 
994
    def test_enable(self):
 
995
        for client in self.clients:
 
996
            client.attributes["Enabled"] = False
 
997
 
 
998
        EnableCmd().run(None, self.clients)
 
999
 
 
1000
        for client in self.clients:
 
1001
            self.assertTrue(client.attributes["Enabled"])
 
1002
 
 
1003
class TestDisableCmd(TestCmd):
 
1004
    def test_disable(self):
 
1005
        DisableCmd().run(None, self.clients)
 
1006
 
 
1007
        for client in self.clients:
 
1008
            self.assertFalse(client.attributes["Enabled"])
 
1009
 
993
1010
 
994
1011
 
995
1012
def should_only_run_tests():