diff --git a/gramps/gen/filters/rules/test/person_rules_test.py b/gramps/gen/filters/rules/test/person_rules_test.py index 463f5baca..f97d5bcca 100644 --- a/gramps/gen/filters/rules/test/person_rules_test.py +++ b/gramps/gen/filters/rules/test/person_rules_test.py @@ -36,7 +36,7 @@ from gramps.gen.filters.rules.person import ( IsDuplicatedAncestorOf, IsRelatedWith, HasIdOf, IsDefaultPerson, IsFemale, IsMale, MissingParent, MultipleMarriages, NeverMarried, NoBirthdate, NoDeathdate, PeoplePrivate, PeoplePublic, PersonWithIncompleteEvent, - RelationshipPathBetweenBookmarks) + RelationshipPathBetweenBookmarks, HasNameOf, HasSoundexName) TEST_DIR = os.path.abspath(os.path.join(DATA_DIR, "tests")) EXAMPLE = os.path.join(TEST_DIR, "example.gramps") @@ -564,6 +564,22 @@ class BaseTest(unittest.TestCase): b'D3WJQCCGV58IP8PNHZ', b'Q8HKQC3VMRM1M6M7ES', ])) + def test_hassoundexname(self): + """ + Test HasSoundexName rule. + """ + rule = HasSoundexName(['garner']) + self.assertEqual(len(self.filter_with_rule(rule)), 73) + + def test_hasnameof(self): + """ + Test HasNameOf rule. + """ + rule = HasNameOf(['Lewis', 'Garner', 'Dr.', 'Sr', 'Anderson', + 'Big Louie', 'von', 'ZieliƄski', None, None, None]) + self.assertEqual(self.filter_with_rule(rule), set([ + b'GNUJQCL9MD64AM56OH'])) + if __name__ == "__main__": unittest.main()