def test_cli_args_ambiguity(args, success): if success: anonip.parse_arguments(args) return with pytest.raises(SystemExit) as e: anonip.parse_arguments(args) assert e.value.code == 2
def test_ipv6mask_arg(self): self.assertEqual(anonip.parse_arguments(["-6", "64"]).ipv6mask, 64)
def test_ipv4mask_arg(self): self.assertEqual(anonip.parse_arguments(["-4", "24"]).ipv4mask, 24)
def test_columns_arg(self): self.assertEqual(anonip.parse_arguments(["-c", "3", "5"]).columns, [3, 5])
def test_cli_generic_args(args, attribute, expected): assert getattr(anonip.parse_arguments(args), attribute) == expected
def test_regex_concat(args, expected): args = anonip.parse_arguments(args) assert args.regex == re.compile(expected)