/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-17 16:54:02 UTC
  • Revision ID: teddy@recompile.se-20190317165402-g3ljjeea05p5ouvt
mandos-ctl: Refactor tests

* mandos-ctl (TestBaseCommands.test_IsEnabled): Removed; don't test
                                                internal details of
                                                command.IsEnabled.
  (TestBaseCommands.test_IsEnabled_run_exits_successfully): Rename to
                                  "test_IsEnabled_exits_successfully".
  (TestBaseCommands.test_IsEnabled_run_exits_with_failure): Rename to
                                  "test_IsEnabled_exits_with_failure".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1463
1463
 
1464
1464
class TestBaseCommands(TestCommand):
1465
1465
 
1466
 
    def test_IsEnabled(self):
1467
 
        self.assertTrue(all(command.IsEnabled().is_enabled(client,
1468
 
                                                      properties)
1469
 
                            for client, properties
1470
 
                            in self.clients.items()))
1471
 
 
1472
 
    def test_IsEnabled_run_exits_successfully(self):
 
1466
    def test_IsEnabled_exits_successfully(self):
1473
1467
        with self.assertRaises(SystemExit) as e:
1474
1468
            command.IsEnabled().run(self.one_client)
1475
1469
        if e.exception.code is not None:
1477
1471
        else:
1478
1472
            self.assertIsNone(e.exception.code)
1479
1473
 
1480
 
    def test_IsEnabled_run_exits_with_failure(self):
 
1474
    def test_IsEnabled_exits_with_failure(self):
1481
1475
        self.client.attributes["Enabled"] = dbus.Boolean(False)
1482
1476
        with self.assertRaises(SystemExit) as e:
1483
1477
            command.IsEnabled().run(self.one_client)