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
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
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
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
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
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
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
def test_greater_than_success(self): ''' Test that the current version is newer than the codename ''' assert salt_version.greater_than('Nitrogen') is True
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
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
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
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