def test_complex(self): v1 = Ckan.Version('v6a12') v2 = Ckan.Version('v6a5') self.assertLess(v2, v1) self.assertGreater(v1, v2) self.assertNotEqual(v1, v2)
def test_basic(self): v0 = Ckan.Version('1.2.0') v1 = Ckan.Version('1.2.0') v2 = Ckan.Version('1.2.1') self.assertLess(v1, v2) self.assertGreater(v2, v1) self.assertEqual(v1, v0)
def test_dotSeparatorForExtraData(self): v0 = Ckan.Version('1.0') v1 = Ckan.Version('1.0.repackaged') v2 = Ckan.Version('1.0.1') self.assertLess(v0, v1) self.assertLess(v1, v2) self.assertGreater(v1, v0) self.assertGreater(v2, v1)
def test_testSuite(self): v1 = Ckan.Version('1.0') v2 = Ckan.Version('2.0') self.assertTrue(v1 < v2)
def test_differentEpochs(self): v1 = Ckan.Version('1:1') v2 = Ckan.Version('2:1') self.assertNotEqual(v1, v2)
def test_agExt(self): v1 = Ckan.Version('1.20') v2 = Ckan.Version('1.22a') self.assertGreater(v2, v1)
def test_Epoch(self): v1 = Ckan.Version('1.2.0') v2 = Ckan.Version('1:1.2.0') self.assertLess(v1, v2)
def test_unevenVersioning(self): v0 = Ckan.Version('1.1.0.0') v1 = Ckan.Version('1.1.1') self.assertLess(v0, v1) self.assertGreater(v1, v0)
def test_sortAllNumbersBeforeDot(self): v0 = Ckan.Version('1.0_beta') v1 = Ckan.Version('1.0.1_beta') self.assertLess(v0, v1) self.assertGreater(v1, v0)
def test_issue1076(self): v0 = Ckan.Version('1.01') v1 = Ckan.Version('1.1') self.assertEqual(v1, v0)
def test_alpha(self): v1 = Ckan.Version('apple') v2 = Ckan.Version('banana') self.assertLess(v1, v2)
def test_str(self): string = '1.2.3' v1 = Ckan.Version(string) self.assertEqual(string, str(v1)) self.assertEqual(string, v1.string)