Test Pytest

This commit is contained in:
Itscalledpooya 2022-10-06 17:01:56 +03:30 committed by Megan Wilhite
parent 133993aa17
commit e3165a586d
2 changed files with 12 additions and 0 deletions

1
changelog/62281.fixed Normal file
View file

@ -0,0 +1 @@
Fix Salt Package Manager (SPM) exception when calling spm create_repo .

View file

@ -163,6 +163,17 @@ def test_build_install(setup_spm, f1_content, patch_local_client):
assert len(ui._error) == 0
@pytest.fixture()
def test_repo_paths(setup_spm):
_tmp_spm, ui, client, minion_config, minion_opts = setup_spm
with patch("salt.client.Caller", MagicMock(return_value=minion_opts)):
with patch(
"salt.client.get_local_client", MagicMock(return_value=minion_opts["conf_file"])
):
client.run(["create_repo", "."])
assert len(ui._status) == 1
def test_failure_paths(setup_spm, patch_local_client):
_tmp_spm, ui, client, minion_config, minion_opts = setup_spm
fail_args = (