summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-11-07 12:27:21 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-11-07 12:27:21 +0000
commitd86e0a2d80cf66c4b0e8747da30345336ad83a8a (patch)
tree1d505093a72887802030460dc7d00d8f7620d8cd
parent6a4b25e739797ee4e7d9d7933269c0865feba28f (diff)
downloadimport-d86e0a2d80cf66c4b0e8747da30345336ad83a8a.tar.gz
add test bounds with two version
-rwxr-xr-xexts/pip_find_deps_tests.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/exts/pip_find_deps_tests.py b/exts/pip_find_deps_tests.py
index 26fab5e..f4fa82b 100755
--- a/exts/pip_find_deps_tests.py
+++ b/exts/pip_find_deps_tests.py
@@ -29,7 +29,7 @@ class ConflictDetectionTests(unittest.TestCase):
self.test_requirements = parse_requirements(reqs)
# ('<=', 0.1) conflicts with ('>=', 0.2)
- # ('<', '0.1') conflicts with ('>', '0.2')
+
def test_eqs_two_different_versions(self):
# ('==', '0.1') conflicts with ('==', '0.2')
@@ -92,7 +92,7 @@ class ConflictDetectionTests(unittest.TestCase):
# ('!=', '0.1') conflicts with ('==', '0.1')
self.run_conflict_test(reverse(requirements), [reverse(expected_conflict)])
- def test_bounds(self):
+ def test_bounds_one_version(self):
requirements = list(parse_requirements(['a < 0.1', 'a > 0.1']))
expected_conflict = (('<', parse_version('0.1')),
('>', parse_version('0.1')))
@@ -103,6 +103,17 @@ class ConflictDetectionTests(unittest.TestCase):
# ('>', '0.1') conflicts with ('<', '0.1')
self.run_conflict_test(reverse(requirements), [reverse(expected_conflict)])
+ def test_bounds_two_versions(self):
+ requirements = list(parse_requirements(['a < 0.1', 'a > 0.2']))
+ expected_conflict = (('<', parse_version('0.1')),
+ ('>', parse_version('0.2')))
+
+ # ('<', '0.1') conflicts with ('>', '0.2')
+ self.run_conflict_test(requirements, [expected_conflict])
+
+ # ('>', '0.2') conflicts with ('<', '0.1')
+ self.run_conflict_test(reverse(requirements), [reverse(expected_conflict)])
+
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(ConflictDetectionTests)
unittest.TextTestRunner(verbosity=2).run(suite)