|
|
@ -65,14 +65,14 @@ class VersionTestCase(unittest.TestCase):
|
|
|
|
self.assertGreater(Version('2.0'), Version('1.0'))
|
|
|
|
self.assertGreater(Version('2.0'), Version('1.0'))
|
|
|
|
|
|
|
|
|
|
|
|
def testComparingNonTrivial(self):
|
|
|
|
def testComparingNonTrivial(self):
|
|
|
|
self.assertGreater(Version('2.12'), Version('2.2'))
|
|
|
|
versions = [('2.2', '2.12'),
|
|
|
|
self.assertGreater(Version('3.12-12'), Version('3.12-2'))
|
|
|
|
('3.12-2', '3.12-12'),
|
|
|
|
self.assertGreater(Version('2.6.32-5foo1'), Version('2.6.32-5foo0'))
|
|
|
|
('2.6.32-5foo0', '2.6.32-5foo1'),
|
|
|
|
|
|
|
|
('3.14.15-2', '3.16.7-ckt9-3~deb8u1')]
|
|
|
|
self.assertGreater(Version('3.16.7-ckt9-3~deb8u1'),
|
|
|
|
|
|
|
|
Version('3.14.15-2'))
|
|
|
|
for lower, greater in versions:
|
|
|
|
self.assertLess(Version('3.14.15-2'),
|
|
|
|
self.assertGreater(Version(greater), Version(lower))
|
|
|
|
Version('3.16.7-ckt9-3~deb8u1'))
|
|
|
|
self.assertLess(Version(lower), Version(greater))
|
|
|
|
|
|
|
|
|
|
|
|
def testSorting(self):
|
|
|
|
def testSorting(self):
|
|
|
|
l = [Version('3.16.5-1'), Version('3.2.60-1+deb7u3'),
|
|
|
|
l = [Version('3.16.5-1'), Version('3.2.60-1+deb7u3'),
|
|
|
|