Skip to content

Commit 183e819

Browse files
committed
Pull repeated assertion out of if/else block
1 parent 07ed4b0 commit 183e819

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: tests/unit/plugins/connection/aws_ssm/test_aws_ssm.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,16 @@ def test_generate_commands(self, is_windows):
291291
)
292292

293293
# Check contents of generated command dictionaries
294+
assert "command" in test_command_generation[0][0]
295+
assert "method" in test_command_generation[0][0]
296+
assert "headers" in test_command_generation[0][0]
297+
294298
if is_windows:
295-
assert "command" in test_command_generation[0][0]
296-
assert "method" in test_command_generation[0][1]
297-
assert "headers" in test_command_generation[0][1]
298299
assert "Invoke-WebRequest" in test_command_generation[0][1]["command"]
299300
assert test_command_generation[0][1]["method"] == "put"
300301
# Two command dictionaries are generated for Windows
301302
assert len(test_command_generation[0]) == 2
302303
else:
303-
assert "method" in test_command_generation[0][2]
304-
assert "headers" in test_command_generation[0][2]
305304
assert "curl --request PUT -H" in test_command_generation[0][2]["command"]
306305
assert test_command_generation[0][2]["method"] == "put"
307306
# Three command dictionaries are generated on non-Windows systems

0 commit comments

Comments
 (0)