Exemple #1
0
 def test_with_public_event_should_not_anonymize(self,
                                                 m_anonymize_event) -> None:
     event = IdentifiableEvent('E0', Event.Type.BIRTH)
     event.private = False
     ancestry = Ancestry()
     ancestry.events[event.id] = event
     anonymize(ancestry)
     m_anonymize_event.assert_not_called()
Exemple #2
0
 def test_with_private_event_should_anonymize(self,
                                              m_anonymize_event) -> None:
     event = IdentifiableEvent('E0', Event.Type.BIRTH)
     event.private = True
     ancestry = Ancestry()
     ancestry.events[event.id] = event
     anonymize(ancestry)
     m_anonymize_event.assert_called_once_with(event)
Exemple #3
0
 def test_privatize_event_should_privatize_if_private(self):
     source_file = File('F0', __file__)
     source = Source('The Source')
     source.files.append(source_file)
     citation_file = File('F1', __file__)
     citation = IdentifiableCitation('C0', source)
     citation.files.append(citation_file)
     event_file = File('F1', __file__)
     event = IdentifiableEvent('E1', Birth())
     event.private = True
     event.citations.append(citation)
     event.files.append(event_file)
     person = Person('P0')
     Presence(person, Subject(), event)
     ancestry = Ancestry()
     ancestry.events[event.id] = event
     privatize(ancestry)
     self.assertTrue(event.private)
     self.assertTrue(event_file.private)
     self.assertTrue(citation.private)
     self.assertTrue(source.private)
     self.assertTrue(citation_file.private)
     self.assertTrue(source_file.private)
     self.assertIsNone(person.private)