Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Mar 9, 2024
1 parent 60f3d03 commit 5eeff50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
10 changes: 5 additions & 5 deletions tests/test_api/test_api_deploys.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_deploy(state=None, host=None):
run_ops(state)

first_op_hash = op_order[0]
assert state.op_meta[first_op_hash].names == {"test_deploy | Server/Shell"}
assert state.op_meta[first_op_hash].names == {"test_deploy | server.shell"}
assert state.ops[somehost][first_op_hash].operation_meta._commands == [
StringCommand("echo first command"),
]
Expand All @@ -49,7 +49,7 @@ def test_deploy(state=None, host=None):
]

second_op_hash = op_order[1]
assert state.op_meta[second_op_hash].names == {"test_deploy | Server/Shell"}
assert state.op_meta[second_op_hash].names == {"test_deploy | server.shell"}
assert state.ops[somehost][second_op_hash].operation_meta._commands == [
StringCommand("echo second command"),
]
Expand Down Expand Up @@ -104,21 +104,21 @@ def test_deploy():
run_ops(state)

first_op_hash = op_order[0]
assert state.op_meta[first_op_hash].names == {"test_deploy | Server/Shell"}
assert state.op_meta[first_op_hash].names == {"test_deploy | server.shell"}
assert state.ops[somehost][first_op_hash].operation_meta._commands == [
StringCommand("echo first command"),
]

second_op_hash = op_order[1]
assert state.op_meta[second_op_hash].names == {
"test_deploy | test_nested_deploy | Server/Shell",
"test_deploy | test_nested_deploy | server.shell",
}
assert state.ops[somehost][second_op_hash].operation_meta._commands == [
StringCommand("echo nested command"),
]

third_op_hash = op_order[2]
assert state.op_meta[third_op_hash].names == {"test_deploy | Server/Shell"}
assert state.op_meta[third_op_hash].names == {"test_deploy | server.shell"}
assert state.ops[somehost][third_op_hash].operation_meta._commands == [
StringCommand("echo second command"),
]
2 changes: 1 addition & 1 deletion tests/test_api/test_api_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_op(self):
first_op_hash = op_order[0]

# Ensure the op name
assert state.op_meta[first_op_hash].names == {"Files/File"}
assert state.op_meta[first_op_hash].names == {"files.file"}

# Ensure the global kwargs (same for both hosts)
somehost_global_arguments = state.ops[somehost][first_op_hash].global_arguments
Expand Down
6 changes: 0 additions & 6 deletions tests/test_connectors/test_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@


class TestTerraformConnector(TestCase):
def test_make_names_data_no_output_key(self):
with self.assertRaises(InventoryError) as context:
list(TerraformInventoryConnector.make_names_data())

assert context.exception.args[0] == "No Terraform output key!"

@patch("pyinfra.connectors.terraform.local.shell")
def test_make_names_data_no_output(self, fake_shell):
fake_shell.return_value = json.dumps(
Expand Down

0 comments on commit 5eeff50

Please sign in to comment.