Skip to content

Commit

Permalink
Add test for validation error from remote
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Sep 16, 2024
1 parent 0b37f88 commit de48ba0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/serialisers/test_azure_serialisable_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,12 @@ def test_from_remote(self, mocker, context, example_config_yaml):
context.storage_account_name,
context.storage_container_name,
)

def test_from_remote_validation_error(self, mocker, context, example_config_yaml):
example_config_yaml = example_config_yaml.replace("5", "abc")
mocker.patch.object(AzureSdk, "download_blob", return_value=example_config_yaml)
with raises(
DataSafeHavenTypeError,
match="'file.yaml' does not contain a valid Example configuration.",
):
ExampleAzureSerialisableModel.from_remote(context)

0 comments on commit de48ba0

Please sign in to comment.