/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:38:56 UTC
  • Revision ID: teddy@recompile.se-20190304183856-vwfu3gje6wy6pnjn
mandos-ctl: Improve tests

* mandos-ctl (TestIsEnabledCmd.test_is_enabled_run_exits_successfully,
  TestIsEnabledCmd.test_is_enabled_run_exits_with_failure): Call
  run(), not run_on_one_client().

Show diffs side-by-side

added added

removed removed

Lines of Context:
954
954
    def test_is_enabled_run_exits_successfully(self):
955
955
        client = self.clients["foo"]
956
956
        with self.assertRaises(SystemExit) as e:
957
 
            IsEnabledCmd().run_on_one_client(client)
 
957
            IsEnabledCmd().run(None, [client])
958
958
        if e.exception.code is not None:
959
959
            self.assertEqual(e.exception.code, 0)
960
960
        else:
963
963
        client = self.clients["foo"]
964
964
        client["Enabled"] = dbus.Boolean(False)
965
965
        with self.assertRaises(SystemExit) as e:
966
 
            IsEnabledCmd().run_on_one_client(client)
 
966
            IsEnabledCmd().run(None, [client])
967
967
        if isinstance(e.exception.code, int):
968
968
            self.assertNotEqual(e.exception.code, 0)
969
969
        else: