Example #1
0
    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"))
Example #2
0
    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"))
Example #3
0
 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")
Example #4
0
 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")
Example #5
0
 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])