/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-06 18:30:45 UTC
  • mto: (237.7.594 trunk)
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190306183045-blmd3hb7vy4q6waj
mandos-ctl: Add test for the --enable option

* mandos-ctl (TestOptions.test_enable): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1120
1120
        self.parser = argparse.ArgumentParser()
1121
1121
        add_command_line_options(self.parser)
1122
1122
    def commands_from_args(self, args):
1123
 
        options = self.parser.parse_args(args)
1124
 
        return commands_from_options(options)
 
1123
        self.options = self.parser.parse_args(args)
 
1124
        return commands_from_options(self.options)
1125
1125
    def test_default_is_show_table(self):
1126
1126
        commands = self.commands_from_args([])
1127
1127
        self.assertEqual(len(commands), 1)
1134
1134
        command = commands[0]
1135
1135
        self.assertIsInstance(command, PrintTableCmd)
1136
1136
        self.assertEqual(command.verbose, True)
 
1137
    def test_enable(self):
 
1138
        commands = self.commands_from_args(["--enable", "foo"])
 
1139
        self.assertEqual(len(commands), 1)
 
1140
        command = commands[0]
 
1141
        self.assertIsInstance(command, EnableCmd)
 
1142
        self.assertEqual(self.options.client, ["foo"])
1137
1143
 
1138
1144
 
1139
1145