Beispiel #1
0
 def test_should_remove_names(self) -> None:
     person = Person('P0')
     name = PersonName('Jane', 'Dough')
     source = Source('The Source')
     citation = Citation(source)
     name.citations.append(citation)
     person.names.append(name)
     anonymize_person(person)
     self.assertEquals(0, len(person.names))
     self.assertEquals(0, len(citation.facts))
Beispiel #2
0
    def test_should_not_remove_parents_with_public_descendants(self) -> None:
        person = Person('P0')
        person.private = True
        child = Person('P1')
        child.private = False
        person.children.append(child)
        parent = Person('P2')
        parent.private = True
        person.parents.append(parent)

        anonymize_person(person)
        self.assertCountEqual([parent], person.parents)
Beispiel #3
0
 def _populate_people(self):
     for person_id, person_name in _PEOPLE.items():
         person = self._ancestry.people[person_id]
         anonymize_person(person)
         person.names.prepend(person_name)
Beispiel #4
0
 def test_should_remove_files(self) -> None:
     person = Person('P0')
     person.files.append(File('F0', __file__))
     anonymize_person(person)
     self.assertEquals(0, len(person.files))