def testGT(self): ver = utils.Version("3.3.0") self.assertTrue(ver > "3.2.0") self.assertTrue(ver > "1.3") self.assertFalse(ver > "3.3.0") self.assertFalse(ver >= "5.3") self.assertFalse(ver >= utils.Version("5.3"))
def testLT(self): ver = utils.Version("3.3.0") self.assertTrue(ver < "3.5.0") self.assertTrue(ver < "3.3.1") self.assertTrue(ver < "5.3") self.assertFalse(ver < "3.3.0") self.assertFalse(ver < "1.3") self.assertFalse(ver < utils.Version("2.3"))
def testEQ(self): ver = utils.Version("3.3.0") self.assertEqual(ver, utils.Version("3.3.0")) self.assertTrue(ver == "3.3.0") self.assertFalse(ver == "3.3.1") self.assertFalse(ver == "1.3")
def testNE(self): ver = utils.Version("3.3.0") self.assertNotEqual(ver, utils.Version("3.3.2")) self.assertFalse(ver != "3.3.0") self.assertTrue(ver != "3.3.1") self.assertTrue(ver != "1.3")
def test_ctor(self): ver = utils.Version("3.3.5.0") self.assertEqual(ver._vs, "3.3.5.0") self.assertEqual(ver.fields, [3,3,5,0])