diff options
author | Michael Hudson <michael.hudson@linaro.org> | 2010-12-14 17:21:38 +1300 |
---|---|---|
committer | Michael Hudson <michael.hudson@linaro.org> | 2010-12-14 17:21:38 +1300 |
commit | 78aa2a68c479f2046a407c6855bd63708fbc6005 (patch) | |
tree | 038e22ea8aab614f7e265f665cc48d95cea941ed /hwpack | |
parent | 5f85c9f26bcbc55e69be65ff6201aa873aa7f694 (diff) |
tests that are the core of the issue
Diffstat (limited to 'hwpack')
-rw-r--r-- | hwpack/tests/test_packages.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/hwpack/tests/test_packages.py b/hwpack/tests/test_packages.py index 0767823..dda6d6d 100644 --- a/hwpack/tests/test_packages.py +++ b/hwpack/tests/test_packages.py @@ -156,7 +156,7 @@ class StringifyRelationshipTests(TestCaseWithFixtures): self.assertEqual( "bar | baz", stringify_relationship(candidate, "Depends")) - def test_package_with_version(self): + def test_package_with_le(self): target_package = DummyFetchedPackage( "foo", "1.0", depends="baz (<= 2.0)") source = self.useFixture(AptSourceFixture([target_package])) @@ -165,6 +165,42 @@ class StringifyRelationshipTests(TestCaseWithFixtures): self.assertEqual( "baz (<= 2.0)", stringify_relationship(candidate, "Depends")) + def test_package_with_lt(self): + target_package = DummyFetchedPackage( + "foo", "1.0", depends="baz (<< 2.0)") + source = self.useFixture(AptSourceFixture([target_package])) + with IsolatedAptCache([source.sources_entry]) as cache: + candidate = cache.cache['foo'].candidate + self.assertEqual( + "baz (<< 2.0)", stringify_relationship(candidate, "Depends")) + + def test_package_with_eq(self): + target_package = DummyFetchedPackage( + "foo", "1.0", depends="baz (= 2.0)") + source = self.useFixture(AptSourceFixture([target_package])) + with IsolatedAptCache([source.sources_entry]) as cache: + candidate = cache.cache['foo'].candidate + self.assertEqual( + "baz (= 2.0)", stringify_relationship(candidate, "Depends")) + + def test_package_with_gt(self): + target_package = DummyFetchedPackage( + "foo", "1.0", depends="baz (>> 2.0)") + source = self.useFixture(AptSourceFixture([target_package])) + with IsolatedAptCache([source.sources_entry]) as cache: + candidate = cache.cache['foo'].candidate + self.assertEqual( + "baz (>> 2.0)", stringify_relationship(candidate, "Depends")) + + def test_package_with_ge(self): + target_package = DummyFetchedPackage( + "foo", "1.0", depends="baz (>= 2.0)") + source = self.useFixture(AptSourceFixture([target_package])) + with IsolatedAptCache([source.sources_entry]) as cache: + candidate = cache.cache['foo'].candidate + self.assertEqual( + "baz (>= 2.0)", stringify_relationship(candidate, "Depends")) + class PackageMakerTests(TestCaseWithFixtures): |