Exemplo n.º 1
0
 def test_dot_is_pygration(self):
     """Check that v0.0.0 is reported as a pygration version."""
     v = VersionNumber("v1.2.3")
     self.assertTrue(v.is_pygration())
     self.assertEqual(v._component(0), "1")
     self.assertEqual(v._component(1), "2")
     self.assertEqual(v._component(2), "3")
Exemplo n.º 2
0
 def test_dot_is_pygration(self):
     """Check that v0.0.0 is reported as a pygration version."""
     v = VersionNumber("v1.2.3")
     self.assertTrue(v.is_pygration())
     self.assertEqual(v._component(0), "1")
     self.assertEqual(v._component(1), "2")
     self.assertEqual(v._component(2), "3")
Exemplo n.º 3
0
 def test_underscore_is_pygration(self):
     """Check that v0_0_0 is reported as a pygration version."""
     v = VersionNumber("v1_2_13")
     self.assertTrue(v.is_pygration())
     self.assertEqual(v._component(0), "1")
     self.assertEqual(v._component(1), "2")
     self.assertEqual(v._component(2), "13")
Exemplo n.º 4
0
 def test_underscore_is_pygration(self):
     """Check that v0_0_0 is reported as a pygration version."""
     v = VersionNumber("v1_2_13")
     self.assertTrue(v.is_pygration())
     self.assertEqual(v._component(0), "1")
     self.assertEqual(v._component(1), "2")
     self.assertEqual(v._component(2), "13")
Exemplo n.º 5
0
 def test_numeric_comparison_double_digits(self):
     """Test that double digit numbers compare later than single digits."""
     v = VersionNumber("v0")
     self.assertTrue(v._component_compare("2", "12") < 0)
Exemplo n.º 6
0
 def test_equality_comparison(self):
     vA = VersionNumber("v001")
     vB = VersionNumber("v001")
     self.assertTrue(vA == vB)
Exemplo n.º 7
0
 def test_self_comparison(self):
     v = VersionNumber("v0.1.2")
     self.assertTrue(cmp(v, v) == 0)
Exemplo n.º 8
0
 def test_dot_comparison(self):
     v1 = VersionNumber("v0.1.2")
     v2 = VersionNumber("v0.2.2")
     self.assertTrue(cmp(v1, v2) < 0)
     self.assertTrue(cmp(v2, v1) > 0)
Exemplo n.º 9
0
 def test_numeric_comparison(self):
     v = VersionNumber("v0")
     self.assertTrue(v._component_compare("1", "2") < 0)
Exemplo n.º 10
0
 def test_underscore_comparison(self):
     v1 = VersionNumber("v0_1_2")
     v2 = VersionNumber("v0_2_2")
     self.assertTrue(cmp(v1, v2) < 0)
     self.assertTrue(cmp(v2, v1) > 0)
Exemplo n.º 11
0
 def test_numeric_compare(self):
     """Test that a numeric version is compared as a number."""
     v1 = VersionNumber("v1-2")
     v2 = VersionNumber("v1-12")
     self.assertTrue(cmp(v1, v2) < 0)
     self.assertTrue(cmp(v2, v1) > 0)
Exemplo n.º 12
0
 def test_extended_version(self):
     """Test that a version with a sub-build number is compared later"""
     v1 = VersionNumber("v1")
     v2 = VersionNumber("v1-2")
     self.assertTrue(cmp(v1, v2) < 0)
     self.assertTrue(cmp(v2, v1) > 0)
Exemplo n.º 13
0
 def test_asdf_is_not_pygration(self):
     """Assert that asdf is reported as not a pygration version."""
     v = VersionNumber("asdf")
     self.assertFalse(v.is_pygration())
Exemplo n.º 14
0
 def test_numeric_comparison_double_digits(self):
     """Test that double digit numbers compare later than single digits."""
     v = VersionNumber("v0")
     self.assertTrue(v._component_compare("2", "12") < 0)
Exemplo n.º 15
0
 def test_asdf_is_not_pygration(self):
     """Assert that asdf is reported as not a pygration version."""
     v = VersionNumber("asdf")
     self.assertFalse(v.is_pygration())
Exemplo n.º 16
0
 def test_dash_comparison(self):
     v1 = VersionNumber("v0-1-2")
     v2 = VersionNumber("v0-2-2")
     self.assertTrue(cmp(v1, v2) < 0)
     self.assertTrue(cmp(v2, v1) > 0)
Exemplo n.º 17
0
 def test_numeric_comparison(self):
     v = VersionNumber("v0")
     self.assertTrue(v._component_compare("1", "2") < 0)
Exemplo n.º 18
0
 def test_find_versions(self):
     v001 = VersionNumber('v001')
     v002 = VersionNumber('v002')
     v07 = VersionNumber('v0-7')
     self._loader._find_files()
     self.assertEqual([v07, v001, v002], self._loader._find_versions())