def test_private(self) -> None: file_id = 'BETTY01' file_path = Path('~') sut = File(file_id, file_path) self.assertIsNone(sut.private) private = True sut.private = private self.assertEquals(private, sut.private)
def test_with_private_file_should_anonymize(self, m_anonymize_file) -> None: file = File('F0', __file__) file.private = True ancestry = Ancestry() ancestry.entities.append(file) anonymize(ancestry, AnonymousCitation(AnonymousSource())) m_anonymize_file.assert_called_once_with(file)
def test_privatize_file_should_privatize_if_private(self): source = Source(None, 'The Source') citation = Citation(None, source) file = File('F0', __file__) file.private = True file.citations.append(citation) ancestry = Ancestry() ancestry.entities.append(file) privatize(ancestry) self.assertTrue(True, file.private) self.assertTrue(citation.private)
def test_privatize_file_should_not_privatize_if_public(self): source = Source(None, 'The Source') citation = Citation(None, source) file = File('F0', __file__) file.private = False file.citations.append(citation) ancestry = Ancestry() ancestry.entities.append(file) privatize(ancestry) self.assertEqual(False, file.private) self.assertIsNone(citation.private)