コード例 #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
ファイル: common.py プロジェクト: dhellmann/oslo-incubator
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_requested_patch_greater(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0.0'))
コード例 #9
0
 def test_requested_minor_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.1'))
コード例 #10
0
 def test_current_patch_not_present_same(self):
     self.assertTrue(versionutils.is_compatible('1.0.0', '1.0'))
コード例 #11
0
 def test_current_patch_not_present_less_than(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0'))
コード例 #12
0
 def test_requested_patch_greater(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0.0'))
コード例 #13
0
 def test_requested_patch_not_present_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.0.1'))
コード例 #14
0
 def test_requested_minor_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.1'))
コード例 #15
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'))
コード例 #16
0
 def test_requested_patch_not_present_less_than(self):
     self.assertTrue(versionutils.is_compatible('1.0', '1.0.1'))
コード例 #17
0
 def test_current_patch_not_present_same(self):
     self.assertTrue(versionutils.is_compatible('1.0.0', '1.0'))
コード例 #18
0
 def test_current_patch_not_present_less_than(self):
     self.assertFalse(versionutils.is_compatible('1.0.1', '1.0'))