test_version.py: minor cleanup.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-07-28 23:41:26 +01:00
parent 2c99294a4f
commit 023f9fa4d3

View File

@ -114,14 +114,14 @@ class CheckRequirement(unittest.TestCase):
self.failUnlessEqual(res, [])
res = cross_check({"argparse": ("unparseable", "")}, [])
self.failUnlessEqual(len(res), 0)
self.failUnlessEqual(res, [])
res = cross_check({}, [("foo", ("unparseable", "", None))])
self.failUnlessEqual(len(res), 1)
self.failUnlessIn("not found by pkg_resources", res[0])
res = cross_check({"distribute": ("1.0", "/somewhere")}, [("setuptools", ("2.0", "/somewhere", "distribute"))])
self.failUnlessEqual(len(res), 0)
self.failUnlessEqual(res, [])
res = cross_check({"distribute": ("1.0", "/somewhere")}, [("setuptools", ("2.0", "/somewhere", None))])
self.failUnlessEqual(len(res), 1)
@ -132,7 +132,7 @@ class CheckRequirement(unittest.TestCase):
self.failUnlessIn("location mismatch", res[0])
res = cross_check({"zope.interface": ("1.0", "")}, [("zope.interface", ("unknown", "", None))])
self.failUnlessEqual(len(res), 0)
self.failUnlessEqual(res, [])
res = cross_check({"foo": ("1.0", "")}, [("foo", ("unknown", "", None))])
self.failUnlessEqual(len(res), 1)
@ -142,13 +142,13 @@ class CheckRequirement(unittest.TestCase):
# the version and the path fail to match.
res = cross_check({"foo": ("1.0", "/somewhere")}, [("foo", ("2.0", "/somewhere", None))])
self.failUnlessEqual(len(res), 0)
self.failUnlessEqual(res, [])
res = cross_check({"foo": ("1.0", "/somewhere")}, [("foo", ("1.0", "/somewhere_different", None))])
self.failUnlessEqual(len(res), 0)
self.failUnlessEqual(res, [])
res = cross_check({"foo": ("1.0-r123", "/somewhere")}, [("foo", ("1.0.post123", "/somewhere_different", None))])
self.failUnlessEqual(len(res), 0)
self.failUnlessEqual(res, [])
res = cross_check({"foo": ("1.0", "/somewhere")}, [("foo", ("2.0", "/somewhere_different", None))])
self.failUnlessEqual(len(res), 1)