示例#1
0
 def test_should_remove_contained_by(self) -> None:
     source = IdentifiableSource('S0', 'The Source')
     contained_by = Source('The Source')
     source.contained_by = contained_by
     anonymous_source = AnonymousSource()
     anonymize_source(source, anonymous_source)
     self.assertIsNone(source.contained_by)
示例#2
0
 def test_should_remove_files(self) -> None:
     source = IdentifiableSource('S0', 'The Source')
     file = File('F0', __file__)
     source.files.append(file)
     anonymous_source = AnonymousSource()
     anonymize_source(source, anonymous_source)
     self.assertEquals(0, len(source.files))
     self.assertIn(file, anonymous_source.files)
示例#3
0
 def test_should_remove_contains(self) -> None:
     source = IdentifiableSource('S0', 'The Source')
     contains = Source('The Source')
     source.contains.append(contains)
     anonymous_source = AnonymousSource()
     anonymize_source(source, anonymous_source)
     self.assertEquals(0, len(source.contains))
     self.assertIn(contains, anonymous_source.contains)
示例#4
0
 def test_should_remove_citations(self) -> None:
     source = IdentifiableSource('S0', 'The Source')
     citation = Citation(source)
     source.citations.append(citation)
     anonymous_source = AnonymousSource()
     anonymize_source(source, anonymous_source)
     self.assertEquals(0, len(source.citations))
     self.assertIn(citation, anonymous_source.citations)