fix .0 tests

This commit is contained in:
Bryce Larson 2020-12-09 05:20:25 +00:00 committed by Pedro Algarvio
parent c291d741f5
commit 11a0c6fee0
2 changed files with 4 additions and 3 deletions

View file

@ -41,8 +41,6 @@ def target_python_version():
@pytest.fixture(scope="session")
def target_salt_version():
target_salt = os.environ["KITCHEN_SUITE"].split("-", 2)[-1].replace("-", ".")
if target_salt.endswith(".0") and float(target_salt) >= 3000:
target_salt = ".".join(target_salt.split(".")[:-1])
if target_salt in ("latest", "master"):
pytest.skip("Don't have a specific salt version to test against")
return target_salt

View file

@ -21,4 +21,7 @@ def test_target_python_version(host, target_python_version):
def test_target_salt_version(host, target_salt_version):
with host.sudo():
ret = host.salt("grains.item", "saltversion", "--timeout=120")
assert ret["saltversion"].startswith(target_salt_version)
if target_salt_version.endswith(".0"):
assert ret["saltversion"] == ".".join(target_salt_version.split(".")[:-1])
else:
assert ret["saltversion"].startswith(target_salt_version)