Ejemplo n.º 1
0
def test_less_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.less_than("Oxygen") is False
Ejemplo n.º 2
0
def test_less_than_with_unassigned_codename():
    """
    Test that when an unassigned codename 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.less_than("Fluorine") is True
Ejemplo n.º 3
0
def test_less_than_with_older_codename():
    """
    Test that the current version is less than the codename.
    """
    with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")):
        with patch(
            "salt.modules.salt_version.get_release_number",
            MagicMock(return_value="2017.7"),
        ):
            assert salt_version.less_than("Nitrogen") is False
Ejemplo n.º 4
0
def test_less_than_success():
    """
    Test that when a newer codename is passed in, the function returns True.
    """
    with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")):
        with patch(
            "salt.modules.salt_version.get_release_number",
            MagicMock(return_value="2019.2"),
        ):
            assert salt_version.less_than("Fluorine") is True
Ejemplo n.º 5
0
 def test_less_than_with_unassigned_codename(self):
     '''
     Test that when an unassigned codename greater than the current version.
     '''
     assert salt_version.less_than('Fluorine') is True
Ejemplo n.º 6
0
 def test_less_than_with_older_codename(self):
     '''
     Test that the current version is less than the codename.
     '''
     assert salt_version.less_than('Nitrogen') is False
Ejemplo n.º 7
0
 def test_less_than_with_equal_codename(self):
     '''
     Test that when an equal codename is passed in, the function returns False.
     '''
     assert salt_version.less_than('Oxygen') is False
Ejemplo n.º 8
0
 def test_less_than_success(self):
     '''
     Test that when a newer codename is passed in, the function returns True.
     '''
     assert salt_version.less_than('Fluorine') is True
Ejemplo n.º 9
0
 def test_less_than_with_unassigned_codename(self):
     """
     Test that when an unassigned codename greater than the current version.
     """
     assert salt_version.less_than("Fluorine") is True
Ejemplo n.º 10
0
 def test_less_than_with_older_codename(self):
     """
     Test that the current version is less than the codename.
     """
     assert salt_version.less_than("Nitrogen") is False
Ejemplo n.º 11
0
 def test_less_than_with_equal_codename(self):
     """
     Test that when an equal codename is passed in, the function returns False.
     """
     assert salt_version.less_than("Oxygen") is False
Ejemplo n.º 12
0
 def test_less_than_success_new_version(self):
     """
     Test that when a newer codename is passed in, the function returns True
     using new version
     """
     assert salt_version.less_than("Fluorine") is True