Skip to content

Commit ae7f1be

Browse files
twangboydwoz
authored andcommitted
Clean up tests
1 parent 5cc1a33 commit ae7f1be

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

tests/pytests/integration/cli/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
@pytest.fixture(scope="package")
5-
@pytest.mark.core_test
65
def salt_eauth_account(salt_eauth_account_factory):
76
with salt_eauth_account_factory as account:
87
yield account

tests/pytests/integration/pillar/test_fileclient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ def test_pillar_using_cp_module(salt_master, salt_minion, salt_cli, tmp_path):
66
"""
77
my_file = tmp_path / "my_file.txt"
88
my_file.write_text("foobar")
9-
my_file_contents = my_file.read_text()
109
my_pillar = f"""
1110
{{%- set something = salt['cp.get_file_str']("{str(my_file)}") %}}
1211
file_content: {{{{ something }}}}
1312
"""
1413
with salt_master.pillar_tree.base.temp_file("top.sls", pillar_top):
1514
with salt_master.pillar_tree.base.temp_file("my_pillar.sls", my_pillar):
15+
16+
# We may need this for the following pillar.item to work
1617
ret = salt_cli.run("state.apply", minion_tgt=salt_minion.id)
1718
assert ret.returncode == 1
1819
assert (
@@ -24,5 +25,4 @@ def test_pillar_using_cp_module(salt_master, salt_minion, salt_cli, tmp_path):
2425
"pillar.item", "file_content", minion_tgt=salt_minion.id
2526
)
2627
assert pillar_ret.returncode == 0
27-
2828
assert '"file_content": "foobar"' in pillar_ret.stdout

tests/pytests/integration/pillar/test_httpclient_in_pillar.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,19 @@ def test_pillar_using_http_query(salt_master, salt_minion, salt_cli):
99
http_query_test: {{ something }}
1010
"""
1111

12-
with salt_master.pillar_tree.base.temp_file(
13-
"top.sls",
14-
pillar_top,
15-
) as p_top:
16-
with salt_master.pillar_tree.base.temp_file(
17-
"http_pillar_test.sls", my_pillar
18-
) as p_data:
19-
top_content = p_top.read_text()
20-
pillar_content = p_data.read_text()
12+
with salt_master.pillar_tree.base.temp_file("top.sls", pillar_top):
13+
with salt_master.pillar_tree.base.temp_file("http_pillar_test.sls", my_pillar):
14+
15+
# We may need this for the following pillar.item to work
2116
ret = salt_cli.run("state.apply", minion_tgt=salt_minion.id)
2217
assert ret.returncode == 1
2318
assert (
24-
ret.data["no_|-states_|-states_|-None"]["comment"]
19+
ret.json["no_|-states_|-states_|-None"]["comment"]
2520
== "No states found for this minion"
2621
)
2722

2823
pillar_ret = salt_cli.run(
2924
"pillar.item", "http_query_test", minion_tgt=salt_minion.id
3025
)
3126
assert pillar_ret.returncode == 0
32-
3327
assert '"http_query_test": 200' in pillar_ret.stdout

0 commit comments

Comments
 (0)