From a56792ae0d4cd7e1723dce361d8d92b850dcd1d7 Mon Sep 17 00:00:00 2001 From: Jared Howland <1877384+jaredhowland@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:08:15 -0600 Subject: [PATCH] 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 --- tests/test_individual.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_individual.py b/tests/test_individual.py index a02e4c1..0e66015 100644 --- a/tests/test_individual.py +++ b/tests/test_individual.py @@ -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