Exemplo n.º 1
0
 def test_lt_le(self):
     req1 = VersionRequirement("", "", "<", "1.2.3")
     req2 = VersionRequirement("", "", "<=", "1.2.3")
     req3 = VersionRequirement("", "", "<=", "9.9.9")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req3))
     self.assertTrue(req3.compatible_with(req1))
Exemplo n.º 2
0
 def test_eq_eq(self):
     req1 = VersionRequirement("", "", "=", "1.2.3")
     req2 = VersionRequirement("", "", "=", "1.2.3")
     req3 = VersionRequirement("", "", "=", "3.2.1")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req3))
     self.assertFalse(req3.compatible_with(req2))
Exemplo n.º 3
0
 def test_eq_ge(self):
     req1 = VersionRequirement("", "", "=", "1.2.3")
     req2 = VersionRequirement("", "", ">=", "1.0.6")
     req3 = VersionRequirement("", "", ">=", "1.2.3")
     req4 = VersionRequirement("", "", ">=", "3.1.2")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req3))
     self.assertTrue(req3.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req4))
     self.assertFalse(req4.compatible_with(req1))
Exemplo n.º 4
0
 def test_gt_ge(self):
     req1 = VersionRequirement("", "", ">", "1.2.3")
     req2 = VersionRequirement("", "", ">=", "1.2.0")
     req3 = VersionRequirement("", "", ">=", "1.2.3")
     req4 = VersionRequirement("", "", ">=", "9.9.9")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req3))
     self.assertTrue(req3.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req4))
     self.assertTrue(req4.compatible_with(req1))
Exemplo n.º 5
0
 def test_lt_le(self):
     req1 = VersionRequirement("", "", "<", "1.2.3")
     req2 = VersionRequirement("", "", "<=", "1.2.3")
     req3 = VersionRequirement("", "", "<=", "9.9.9")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req3))
     self.assertTrue(req3.compatible_with(req1))
Exemplo n.º 6
0
 def test_eq_eq(self):
     req1 = VersionRequirement("", "", "=", "1.2.3")
     req2 = VersionRequirement("", "", "=", "1.2.3")
     req3 = VersionRequirement("", "", "=", "3.2.1")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req3))
     self.assertFalse(req3.compatible_with(req2))
Exemplo n.º 7
0
 def test_eq_approx(self):
     req1 = VersionRequirement("", "", "=", "1.2.3")
     req2 = VersionRequirement("", "", "~>", "1")
     req3 = VersionRequirement("", "", "~>", "2")
     req4 = VersionRequirement("", "", "~>", "1.0")
     req5 = VersionRequirement("", "", "~>", "1.2")
     req6 = VersionRequirement("", "", "~>", "1.2.0")
     req7 = VersionRequirement("", "", "~>", "1.2.4")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req3))
     self.assertFalse(req3.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req4))
     self.assertTrue(req4.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req5))
     self.assertTrue(req5.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req6))
     self.assertTrue(req6.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req7))
     self.assertFalse(req7.compatible_with(req1))
Exemplo n.º 8
0
 def test_approx_approx(self):
     req1 = VersionRequirement("", "", "~>", "1.2.3")
     req2 = VersionRequirement("", "", "~>", "1")
     req3 = VersionRequirement("", "", "~>", "2")
     req4 = VersionRequirement("", "", "~>", "0.1")
     req5 = VersionRequirement("", "", "~>", "1.2")
     req6 = VersionRequirement("", "", "~>", "1.3")
     req7 = VersionRequirement("", "", "~>", "1.0.9")
     req8 = VersionRequirement("", "", "~>", "1.2.2")
     req9 = VersionRequirement("", "", "~>", "1.2.3")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req3))
     self.assertFalse(req3.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req4))
     self.assertFalse(req4.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req5))
     self.assertTrue(req5.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req6))
     self.assertFalse(req6.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req7))
     self.assertFalse(req7.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req8))
     self.assertTrue(req8.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req9))
     self.assertTrue(req9.compatible_with(req1))
Exemplo n.º 9
0
 def test_eq_approx(self):
     req1 = VersionRequirement("", "", "=", "1.2.3")
     req2 = VersionRequirement("", "", "~>", "1")
     req3 = VersionRequirement("", "", "~>", "2")
     req4 = VersionRequirement("", "", "~>", "1.0")
     req5 = VersionRequirement("", "", "~>", "1.2")
     req6 = VersionRequirement("", "", "~>", "1.2.0")
     req7 = VersionRequirement("", "", "~>", "1.2.4")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req3))
     self.assertFalse(req3.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req4))
     self.assertTrue(req4.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req5))
     self.assertTrue(req5.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req6))
     self.assertTrue(req6.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req7))
     self.assertFalse(req7.compatible_with(req1))
Exemplo n.º 10
0
 def test_eq_ge(self):
     req1 = VersionRequirement("", "", "=", "1.2.3")
     req2 = VersionRequirement("", "", ">=", "1.0.6")
     req3 = VersionRequirement("", "", ">=", "1.2.3")
     req4 = VersionRequirement("", "", ">=", "3.1.2")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req3))
     self.assertTrue(req3.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req4))
     self.assertFalse(req4.compatible_with(req1))
Exemplo n.º 11
0
 def test_approx_approx(self):
     req1 = VersionRequirement("", "", "~>", "1.2.3")
     req2 = VersionRequirement("", "", "~>", "1")
     req3 = VersionRequirement("", "", "~>", "2")
     req4 = VersionRequirement("", "", "~>", "0.1")
     req5 = VersionRequirement("", "", "~>", "1.2")
     req6 = VersionRequirement("", "", "~>", "1.3")
     req7 = VersionRequirement("", "", "~>", "1.0.9")
     req8 = VersionRequirement("", "", "~>", "1.2.2")
     req9 = VersionRequirement("", "", "~>", "1.2.3")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req3))
     self.assertFalse(req3.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req4))
     self.assertFalse(req4.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req5))
     self.assertTrue(req5.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req6))
     self.assertFalse(req6.compatible_with(req1))
     self.assertFalse(req1.compatible_with(req7))
     self.assertFalse(req7.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req8))
     self.assertTrue(req8.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req9))
     self.assertTrue(req9.compatible_with(req1))
Exemplo n.º 12
0
 def test_gt_ge(self):
     req1 = VersionRequirement("", "", ">", "1.2.3")
     req2 = VersionRequirement("", "", ">=", "1.2.0")
     req3 = VersionRequirement("", "", ">=", "1.2.3")
     req4 = VersionRequirement("", "", ">=", "9.9.9")
     self.assertTrue(req1.compatible_with(req2))
     self.assertTrue(req2.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req3))
     self.assertTrue(req3.compatible_with(req1))
     self.assertTrue(req1.compatible_with(req4))
     self.assertTrue(req4.compatible_with(req1))