waft.framework_unit_tests.test_cli.test_vm_cli_unit module¶
Unit tests for VM CLI commands with mocked Terraform operations.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestConfigWriterIntegration¶
Bases:
object
Test ConfigWriter operations with real file I/O.
- test_config_updates_during_create(mock_ssh_handler, mock_terraform_operator, temp_config_file)¶
Test that config file is properly updated during VM creation.
- test_config_updates_during_destroy(mock_terraform_operator, temp_config_file)¶
Test that config file is properly updated during VM destruction.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestVmCommandIntegration¶
Bases:
object
Test command integration with mocked infrastructure operations.
- test_full_lifecycle_mocked(mock_test_connection, mock_ssh_handler, mock_terraform_operator, temp_config_file)¶
Test full VM lifecycle with mocked operations.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestVmCommandValidation¶
Bases:
object
Test command validation and error handling.
- test_config_file_handling()¶
Test config file parameter handling.
- test_missing_required_args(temp_config_file)¶
Test commands fail appropriately with missing arguments.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestVmCreateCommand¶
Bases:
object
Test VM create command with mocked Terraform operations.
- test_create_success(mock_ssh_handler, mock_terraform_operator, temp_config_file)¶
Test successful VM creation command.
- test_create_terraform_failure(mock_terraform_operator, temp_config_file)¶
Test creation with Terraform failure.
- test_create_with_custom_params(mock_ssh_handler, mock_terraform_operator, temp_config_file)¶
Test VM creation with custom parameters.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestVmDestroyCommand¶
Bases:
object
Test VM destroy command with mocked Terraform operations.
- test_destroy_success(mock_terraform_operator, temp_config_file)¶
Test successful VM destruction.
- test_destroy_terraform_failure(mock_terraform_operator, temp_config_file)¶
Test destruction with Terraform failure.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestVmInspectCommand¶
Bases:
object
Test VM inspect command with mocked SSH operations.
- test_inspect_nonexistent_system(temp_config_file)¶
Test inspection of non-existent system.
- test_inspect_ssh_failure(mock_test_connection, temp_config_file)¶
Test inspection with SSH connection failure.
- test_inspect_success(mock_test_connection, temp_config_file)¶
Test successful VM inspection.
- class waft.framework_unit_tests.test_cli.test_vm_cli_unit.TestVmRedeployCommand¶
Bases:
object
Test VM redeploy command with mocked Terraform operations.
- test_redeploy_nonexistent_system(mock_terraform_operator, temp_config_file)¶
Test redeploy of non-existent system.
- test_redeploy_success(mock_ssh_handler, mock_terraform_operator, temp_config_file)¶
Test successful VM redeploy command.
- waft.framework_unit_tests.test_cli.test_vm_cli_unit.mock_terraform_operator()¶
Mock TerraformOperator to avoid actual infrastructure operations.
- waft.framework_unit_tests.test_cli.test_vm_cli_unit.temp_config_file(tmp_path)¶
Create a temporary config file for testing.