From 5eeff509ac770329ffeebdd7d17339e7221a190d Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Sat, 9 Mar 2024 11:32:22 +0000 Subject: [PATCH] Update tests --- tests/test_api/test_api_deploys.py | 10 +++++----- tests/test_api/test_api_operations.py | 2 +- tests/test_connectors/test_terraform.py | 6 ------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/test_api/test_api_deploys.py b/tests/test_api/test_api_deploys.py index 1e329d7f6..6ea886d07 100644 --- a/tests/test_api/test_api_deploys.py +++ b/tests/test_api/test_api_deploys.py @@ -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"), ] @@ -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"), ] @@ -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"), ] diff --git a/tests/test_api/test_api_operations.py b/tests/test_api/test_api_operations.py index a0e40fc25..4eded9028 100644 --- a/tests/test_api/test_api_operations.py +++ b/tests/test_api/test_api_operations.py @@ -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 diff --git a/tests/test_connectors/test_terraform.py b/tests/test_connectors/test_terraform.py index 2fb54d85f..8a634e8c5 100644 --- a/tests/test_connectors/test_terraform.py +++ b/tests/test_connectors/test_terraform.py @@ -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(