示例#1
0
def test_greater_than_with_equal_codename():
    """
    Test that when an equal codename is passed in, the function returns False.
    """
    with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")):
        with patch("salt.version.SaltStackVersion.LNAMES", {"oxygen": (2018, 3)}):
            assert salt_version.greater_than("Oxygen") is False
示例#2
0
def test_greater_than_success_new_version():
    """
    Test that the current version is newer than the codename
    """
    with patch(
        "salt.modules.salt_version.get_release_number", MagicMock(return_value="2017.7")
    ):
        with patch("salt.version.SaltStackVersion", MagicMock(return_value="3000")):
            assert salt_version.greater_than("Nitrogen") is True
示例#3
0
def test_greater_than_unassigned():
    """
    Test that the unassigned codename is greater than the current version
    """
    with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")):
        with patch(
            "salt.modules.salt_version.get_release_number",
            MagicMock(return_value="No version assigned."),
        ):
            assert salt_version.greater_than("Fluorine") is False
示例#4
0
def test_greater_than_with_newer_codename():
    """
    Test that when a newer codename is passed in, the function returns False.
    """
    with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")):
        with patch(
            "salt.version.SaltStackVersion.LNAMES",
            {"fluorine": (2019, 2), "oxygen": (2018, 3)},
        ):
            assert salt_version.greater_than("Fluorine") is False
示例#5
0
 def test_greater_than_unassigned(self):
     '''
     Test that the unassigned codename is greater than the current version
     '''
     assert salt_version.greater_than('Fluorine') is False
示例#6
0
 def test_greater_than_with_newer_codename(self):
     '''
     Test that when a newer codename is passed in, the function returns False.
     '''
     assert salt_version.greater_than('Fluorine') is False
示例#7
0
 def test_greater_than_with_equal_codename(self):
     '''
     Test that when an equal codename is passed in, the function returns False.
     '''
     assert salt_version.greater_than('Oxygen') is False
示例#8
0
 def test_greater_than_success(self):
     '''
     Test that the current version is newer than the codename
     '''
     assert salt_version.greater_than('Nitrogen') is True
示例#9
0
 def test_greater_than_unassigned(self):
     """
     Test that the unassigned codename is greater than the current version
     """
     assert salt_version.greater_than("Fluorine") is False
示例#10
0
 def test_greater_than_with_newer_codename(self):
     """
     Test that when a newer codename is passed in, the function returns False.
     """
     assert salt_version.greater_than("Fluorine") is False
示例#11
0
 def test_greater_than_with_equal_codename(self):
     """
     Test that when an equal codename is passed in, the function returns False.
     """
     assert salt_version.greater_than("Oxygen") is False
示例#12
0
 def test_greater_than_success_new_version(self):
     """
     Test that the current version is newer than the codename
     """
     assert salt_version.greater_than("Nitrogen") is True