summaryrefslogtreecommitdiff
path: root/morphlib/artifact_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-09-11 12:54:09 +0000
committerRichard Maw <richard.maw@gmail.com>2014-09-17 15:51:10 +0000
commit8dca2062fab6f9e5681db07c24160b94c6cbc28f (patch)
tree97cd01512576626e83494e8080916b482f8c9cf4 /morphlib/artifact_tests.py
parent37d91b2d42421c6ebc3c54ec79015fc07426a267 (diff)
downloadmorph-8dca2062fab6f9e5681db07c24160b94c6cbc28f.tar.gz
Be more lenient in Artifact dependency unit tests
We don't care if add_dependency causes there to be multiple dependents, just that our artifacts are properly included.
Diffstat (limited to 'morphlib/artifact_tests.py')
-rw-r--r--morphlib/artifact_tests.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/morphlib/artifact_tests.py b/morphlib/artifact_tests.py
index 62b1bfb9..75dfd870 100644
--- a/morphlib/artifact_tests.py
+++ b/morphlib/artifact_tests.py
@@ -67,15 +67,17 @@ class ArtifactTests(unittest.TestCase):
def test_adds_dependency(self):
self.artifact.add_dependency(self.other)
- self.assertEqual(self.artifact.dependencies, [self.other])
- self.assertEqual(self.other.dependents, [self.artifact])
+ self.assertIn(self.other, self.artifact.dependencies)
+ self.assertIn(self.artifact, self.other.dependents)
self.assertTrue(self.artifact.depends_on(self.other))
def test_does_not_add_dependency_twice(self):
self.artifact.add_dependency(self.other)
self.artifact.add_dependency(self.other)
- self.assertEqual(self.artifact.dependencies, [self.other])
- self.assertEqual(self.other.dependents, [self.artifact])
+ self.assertEqual(len([a for a in self.artifact.dependencies
+ if a == self.other]), 1)
+ self.assertEqual(len([a for a in self.other.dependents
+ if a == self.artifact]), 1)
self.assertTrue(self.artifact.depends_on(self.other))
def test_get_dependency_prefix(self):