예제 #1
0
 def test_same_major_true(self):
     """Even though the current version is 2.0, since `same_major` defaults
     to `True`, 1.0 is deemed incompatible.
     """
     self.assertFalse(versionutils.is_compatible('2.0', '1.0'))
     self.assertTrue(versionutils.is_compatible('1.0', '1.0'))
     self.assertFalse(versionutils.is_compatible('1.0', '2.0'))
예제 #2
0
 def test_same_major_true(self):
     """Even though the current version is 2.0, since `same_major` defaults
     to `True`, 1.0 is deemed incompatible.
     """
     self.assertFalse(versionutils.is_compatible('2.0', '1.0'))
     self.assertTrue(versionutils.is_compatible('1.0', '1.0'))
     self.assertFalse(versionutils.is_compatible('1.0', '2.0'))
예제 #3
0
 def test_same_major_false(self):
     """With `same_major` set to False, then major version compatibiity
     rule is not enforced, so a current version of 2.0 is deemed to satisfy
     a requirement of 1.0.
     """
     self.assertFalse(
         versionutils.is_compatible('2.0', '1.0', same_major=False))
     self.assertTrue(
         versionutils.is_compatible('1.0', '1.0', same_major=False))
     self.assertTrue(
         versionutils.is_compatible('1.0', '2.0', same_major=False))
예제 #4
0
 def test_same_major_false(self):
     """With `same_major` set to False, then major version compatibiity
     rule is not enforced, so a current version of 2.0 is deemed to satisfy
     a requirement of 1.0.
     """
     self.assertFalse(versionutils.is_compatible('2.0', '1.0',
                                                 same_major=False))
     self.assertTrue(versionutils.is_compatible('1.0', '1.0',
                                                same_major=False))
     self.assertTrue(versionutils.is_compatible('1.0', '2.0',
                                                same_major=False))
예제 #5
0
def version_is_compatible(imp_version, version):
    """Determine whether versions are compatible.

    :param imp_version: The version implemented
    :param version: The version requested by an incoming message.
    """
    return versionutils.is_compatible(version, imp_version)
예제 #6
0
def version_is_compatible(imp_version, version):
    """Determine whether versions are compatible.

    :param imp_version: The version implemented
    :param version: The version requested by an incoming message.
    """
    return versionutils.is_compatible(version, imp_version)
예제 #7
0
 def test_same_version(self):
     self.assertTrue(versionutils.is_compatible('1', '1'))
     self.assertTrue(versionutils.is_compatible('1.0', '1.0'))
     self.assertTrue(versionutils.is_compatible('1.0.0', '1.0.0'))
예제 #8
0
 def test_current_patch_not_present_less_than(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0'))
예제 #9
0
 def test_current_patch_not_present_same(self):
     self.assertTrue(versionutils.is_compatible('1.0.0', '1.0'))
예제 #10
0
 def test_requested_patch_not_present_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.0.1'))
예제 #11
0
 def test_requested_patch_greater(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0.0'))
예제 #12
0
 def test_requested_minor_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.1'))
예제 #13
0
 def test_same_version(self):
     self.assertTrue(versionutils.is_compatible('1', '1'))
     self.assertTrue(versionutils.is_compatible('1.0', '1.0'))
     self.assertTrue(versionutils.is_compatible('1.0.0', '1.0.0'))
예제 #14
0
 def test_requested_minor_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.1'))
예제 #15
0
 def test_current_patch_not_present_less_than(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0'))
예제 #16
0
 def test_current_patch_not_present_same(self):
     self.assertTrue(versionutils.is_compatible('1.0.0', '1.0'))
예제 #17
0
 def test_requested_patch_not_present_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.0.1'))
예제 #18
0
 def test_requested_patch_greater(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0.0'))