From d4e7d9f1636543f3e20cd8d21c42f24942d32704 Mon Sep 17 00:00:00 2001 From: Bhushan Deshmukh Date: Tue, 7 May 2024 15:37:19 -0700 Subject: [PATCH] fixing the test for empty secret with new format --- zdatasets/tests/utils/test_secret_fetcher.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zdatasets/tests/utils/test_secret_fetcher.py b/zdatasets/tests/utils/test_secret_fetcher.py index 15b64aa..4fe2aca 100644 --- a/zdatasets/tests/utils/test_secret_fetcher.py +++ b/zdatasets/tests/utils/test_secret_fetcher.py @@ -109,8 +109,11 @@ def test_fetch_aws_secret(): SecretFetcher(aws_secret_arn="not-json-decodable", key="key").value # Empty string - with pytest.raises(ValueError): - SecretFetcher(aws_secret_arn="empty").value + with pytest.raises(ValueError) as ve: + SecretFetcher(aws_secret_arn="empty") + assert ( + "Secrets Manager can't find the specified secret value for staging label: AWSCURRENT" + == ve.value.response["Error"]["Message"]) @mock.patch("zdatasets.utils.secret_fetcher.get_current_namespace")