Skip to content

Commit

Permalink
Only use Error prefix in io provider output
Browse files Browse the repository at this point in the history
  • Loading branch information
ksugden committed Jan 24, 2025
1 parent 20eb871 commit b78bf07
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dbt_platform_helper/domain/config_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _validate_extension_supported_versions(

if not isinstance(environments, dict):
self.io.error(
f"Error: {extension_type} extension definition is invalid type, expected dictionary",
f"{extension_type} extension definition is invalid type, expected dictionary",
)
continue
for environment, env_config in environments.items():
Expand Down
2 changes: 1 addition & 1 deletion dbt_platform_helper/domain/terraform_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def generate(self, environment_name, terraform_platform_modules_version_override

if environment_name not in config.get("environments").keys():
raise EnvironmentNotFoundException(
f"Error: cannot generate terraform for environment {environment_name}. It does not exist in your configuration"
f"cannot generate terraform for environment {environment_name}. It does not exist in your configuration"
)

manifest = self.manifest_generator.generate_manifest(
Expand Down
2 changes: 1 addition & 1 deletion dbt_platform_helper/providers/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def warn(self, message: str):
click.secho(message, fg="magenta")

def error(self, message: str):
click.secho(message, fg="red")
click.secho(f"Error: {message}", fg="red")

def info(self, message: str):
click.secho(message)
Expand Down
2 changes: 1 addition & 1 deletion tests/platform_helper/domain/test_terraform_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_raises_a_platform_exception_if_environment_does_not_exist_in_config(sel
)
with pytest.raises(
PlatformException,
match="Error: cannot generate terraform for environment not-an-environment. It does not exist in your configuration",
match="cannot generate terraform for environment not-an-environment. It does not exist in your configuration",
):
terraform_environment.generate("not-an-environment")

Expand Down
2 changes: 1 addition & 1 deletion tests/platform_helper/providers/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_warn_calls_secho_with_correct_formatting(self, mock_echo):
def test_error_calls_secho_with_correct_formatting(self, mock_echo):
io = ClickIOProvider()
io.error("Error!")
mock_echo.assert_called_once_with("Error!", fg="red")
mock_echo.assert_called_once_with("Error: Error!", fg="red")

@patch("click.secho")
def test_info_calls_secho_with_correct_formatting(self, mock_echo):
Expand Down

0 comments on commit b78bf07

Please sign in to comment.