test: Gedcom file with no FamilySearchID

Added a negative-case assertion
to ensure get_fs_id returns an empty string when an Individual lacks the _FSFTID
tag
This commit is contained in:
Jared Howland committed 2026-04-16 15:08:15 -06:00
1 parent 14cd8beadc
commit a56792ae0d
1 file changed
+7 -1
+7 -1
View File
@@ -80,10 +80,16 @@ class TestIndividualBasicInfo:
"""Test gender extraction."""
assert john_doe.get_gender() == 'M'
def test_get_fs_id(self, john_doe):
def test_get_fs_id(self, john_doe, sample_gedcom_file):
"""Test FamilySearch Tree ID extraction from _FSFTID tag."""
assert john_doe.get_fs_id() == 'G123-ABC'
parser = GedcomParser(sample_gedcom_file)
individuals = parser.get_individuals()
jane = [ind for ind in individuals if 'Jane' in str(ind.get_name())]
jane_doe = Individual(jane[0], parser.parser)
assert jane_doe.get_fs_id() == ''
def test_get_gender_default_unknown(self, sample_gedcom_file):
"""Test that missing gender defaults to 'U'."""
gedcom_content = """0 HEAD