Esempio n. 1
0
 def test_with_private_event_should_anonymize(self,
                                              m_anonymize_event) -> None:
     event = Event('E0', Birth())
     event.private = True
     ancestry = Ancestry()
     ancestry.entities.append(event)
     anonymize(ancestry, AnonymousCitation(AnonymousSource()))
     m_anonymize_event.assert_called_once_with(event)
Esempio n. 2
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 = Citation('C0', source)
     citation.files.append(citation_file)
     event_file = File('F1', __file__)
     event = Event('E1', Birth())
     event.private = True
     event.citations.append(citation)
     event.files.append(event_file)
     person = Person('P0')
     Presence(person, Subject(), event)
     ancestry = Ancestry()
     ancestry.entities.append(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)