Example #1
0
    def test_list_basic(self, args_parser, mocked_config, capsys):
        args = args_parser.parse_args(self.default_parser_args)

        list_groups(args)
        captured = capsys.readouterr()
        parsed_groups = self.extract_groups(captured.out)
        assert parsed_groups
        self.compare_parsed_groups_with_complete(parsed_groups, mocked_config)
Example #2
0
    def test_list_basic(self, args_parser, mocked_config, capsys):
        args = args_parser.parse_args(self.default_parser_args)

        list_groups(args)
        captured = capsys.readouterr()
        parsed_groups = self.extract_groups(captured.out)
        assert parsed_groups
        self.compare_parsed_groups_with_complete(parsed_groups, mocked_config)
Example #3
0
    def test_list_empty(self, args_parser, mocked_config, capsys):
        args = args_parser.parse_args(self.default_parser_args)
        mocked_config["groups"]["test"]["hosts"] = []

        list_groups(args)
        captured = capsys.readouterr()
        parsed_groups = self.extract_groups(captured.out)

        assert parsed_groups
        assert not parsed_groups["test"]
Example #4
0
    def test_list_one_host(self, args_parser, mocked_config, capsys):
        args = args_parser.parse_args(self.default_parser_args)
        mocked_config["groups"]["test"]["hosts"] = ["matching"]

        list_groups(args)
        captured = capsys.readouterr()
        parsed_groups = self.extract_groups(captured.out)

        assert parsed_groups
        self.compare_parsed_groups_with_complete(parsed_groups, mocked_config)
Example #5
0
    def test_list_one_host(self, args_parser, mocked_config, capsys):
        args = args_parser.parse_args(self.default_parser_args)
        mocked_config["groups"]["test"]["hosts"] = ["matching"]

        list_groups(args)
        captured = capsys.readouterr()
        parsed_groups = self.extract_groups(captured.out)

        assert parsed_groups
        self.compare_parsed_groups_with_complete(parsed_groups, mocked_config)
Example #6
0
    def test_list_empty(self, args_parser, mocked_config, capsys):
        args = args_parser.parse_args(self.default_parser_args)
        mocked_config["groups"]["test"]["hosts"] = []

        list_groups(args)
        captured = capsys.readouterr()
        parsed_groups = self.extract_groups(captured.out)

        assert parsed_groups
        assert not parsed_groups["test"]
Example #7
0
 def list_and_compare(self, args, mocked_config, capsys):
     list_groups(args)
     captured = capsys.readouterr()
     parsed_groups = self.extract_groups(captured.out)
     assert parsed_groups
     self.compare_parsed_groups_with_complete(parsed_groups, mocked_config)
Example #8
0
 def list_and_compare(self, args, mocked_config, capsys):
     list_groups(args)
     captured = capsys.readouterr()
     parsed_groups = self.extract_groups(captured.out)
     assert parsed_groups
     self.compare_parsed_groups_with_complete(parsed_groups, mocked_config)