def test_parse_args_rules_default_regexes_specified_with_no_value(self): argv = ["--default-regexes", "--regex"] args = tartufo.parse_args(argv) self.assertTrue( args.do_default_regexes, "args.do_default_regexes should be True, is actually {}".format( args.do_default_regexes))
def test_parse_args_rules_default_regexes_set_to_true(self): argv = ["--default-regexes", "t"] args = tartufo.parse_args(argv) self.assertTrue( args.do_default_regexes, "args.do_default_regexes should be True, is actually {}".format( args.do_default_regexes))
def test_parse_args_git_rules_repo(self): argv = [ "--git-rules-repo", "[email protected]:test-owner/tartufo-test.git" ] expected_git_rules_repo = "[email protected]:test-owner/tartufo-test.git" args = tartufo.parse_args(argv) self.assertEqual(expected_git_rules_repo, args.git_rules_repo)
def test_parse_args_rules_default_regexes_unset(self): argv = [] args = tartufo.parse_args(argv) self.assertTrue( args.do_default_regexes, "args.do_default_regexes should be True, is actually {}".format( args.do_default_regexes))
def test_parse_args_rules_multiple_times(self): argv = ["--rules", "file1", "--rules", "file2"] expected_rules_filenames = ("file1", "file2") args = tartufo.parse_args(argv) self.assertCountEqual( expected_rules_filenames, args.rules_filenames, "args.rules_filenames should be {}, is actually {}".format( expected_rules_filenames, args.rules_filenames))
def test_parse_args_rules_not_specified(self): argv = [] args = tartufo.parse_args(argv) self.assertEqual(0, len(args.rules_filenames), "args.rules_filenames should be empty")