diff options
-rw-r--r-- | morphlib/source.py | 12 | ||||
-rw-r--r-- | morphlib/source_tests.py | 22 |
2 files changed, 0 insertions, 34 deletions
diff --git a/morphlib/source.py b/morphlib/source.py index 41e17e83..50b6e279 100644 --- a/morphlib/source.py +++ b/morphlib/source.py @@ -44,18 +44,6 @@ class Source(object): self.sha1 = sha1 self.morphology = morphology self.filename = filename - self.dependencies = [] - self.dependents = [] - - def add_dependency(self, source): - '''Add ``source`` to the dependency list.''' - if source not in self.dependencies: - self.dependencies.append(source) - source.dependents.append(self) - - def depends_on(self, source): - '''Do we depend on ``source``?''' - return source in self.dependencies def __str__(self): # pragma: no cover return '%s|%s|%s' % (self.repo_name, diff --git a/morphlib/source_tests.py b/morphlib/source_tests.py index a539da29..39635b6b 100644 --- a/morphlib/source_tests.py +++ b/morphlib/source_tests.py @@ -58,26 +58,4 @@ class SourceTests(unittest.TestCase): def test_sets_filename(self): self.assertEqual(self.source.filename, self.filename) - - def test_sets_dependencies_to_empty(self): - self.assertEqual(self.source.dependencies, []) - - def test_sets_dependents_to_empty(self): - self.assertEqual(self.source.dependents, []) - - def test_does_not_depend_on_other_initially(self): - self.assertFalse(self.source.depends_on(self.other)) - - def test_adds_dependency(self): - self.source.add_dependency(self.other) - self.assertEqual(self.source.dependencies, [self.other]) - self.assertEqual(self.other.dependents, [self.source]) - self.assertTrue(self.source.depends_on(self.other)) - - def test_does_not_add_dependency_twice(self): - self.source.add_dependency(self.other) - self.source.add_dependency(self.other) - self.assertEqual(self.source.dependencies, [self.other]) - self.assertEqual(self.other.dependents, [self.source]) - self.assertTrue(self.source.depends_on(self.other)) |