def test_hostname_list(self): args = MagicMock() args.filter_group = None args.show_bundles = False args.show_hostnames = True args.show_groups = False output = list(nodes.bw_nodes(self.repo, args)) self.assertEqual( output, ["node1.example.com", "node2.example.com", "node3.example.com"], )
def test_group_filter(self): args = MagicMock() args.filter_group = "group2" args.show_bundles = False args.show_hostnames = False args.show_groups = False output = list(nodes.bw_nodes(self.repo, args)) self.assertEqual( output, [ "node1", "node2", ], )
def test_groups_list(self): args = MagicMock() args.filter_group = None args.show_bundles = False args.show_hostnames = False args.show_groups = True output = list(nodes.bw_nodes(self.repo, args)) self.assertEqual( output, [ "node1: group1, group2", "node2: group2", "node3: ", ], )