Skip to content

Commit b0b9a4c

Browse files
rnagytwangboy
authored andcommitted
add test for 68522 (mysqlclient version info)
1 parent 3c4034e commit b0b9a4c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/pytests/functional/test_version.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,30 @@ def test_salt_extensions_in_versions_report(tmp_path, salt_extension):
4747
assert salt_extension.name in versions_information["Salt Extensions"]
4848

4949

50+
def test_mysql_extensions_in_versions_report(tmp_path):
51+
with SaltVirtualEnv(venv_dir=tmp_path / ".venv") as venv:
52+
# These are required for the test to pass, why are they not already
53+
# installed?
54+
venv.install("pyyaml")
55+
venv.install("looseversion")
56+
venv.install("packaging")
57+
# Install mysql extension into the virtualenv
58+
venv.install("mysqlclient")
59+
installed_packages = venv.get_installed_packages()
60+
assert "mysqlclient" in installed_packages
61+
ret = venv.run_code(
62+
"""
63+
import json
64+
import salt.version
65+
66+
print(json.dumps(salt.version.versions_information()))
67+
"""
68+
)
69+
versions_information = json.loads(ret.stdout)
70+
assert "Dependency Versions" in versions_information
71+
assert versions_information.get("Dependency Versions").get("mysql-python") is not None
72+
73+
5074
def test_salt_extensions_absent_in_versions_report(tmp_path, salt_extension):
5175
"""
5276
Ensure that the 'Salt Extensions' header does not show up when no extension is installed

0 commit comments

Comments
 (0)