Skip to content

Commit

Permalink
using botocore clienterror exception
Browse files Browse the repository at this point in the history
  • Loading branch information
n3o-Bhushan committed May 7, 2024
1 parent d4e7d9f commit 1b3d8c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zdatasets/tests/utils/test_secret_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import unittest
from unittest import mock
from botocore.exceptions import ClientError

import boto3
import pytest
Expand Down Expand Up @@ -109,11 +110,11 @@ def test_fetch_aws_secret():
SecretFetcher(aws_secret_arn="not-json-decodable", key="key").value

# Empty string
with pytest.raises(ValueError) as ve:
with pytest.raises(ClientError) as ce:
SecretFetcher(aws_secret_arn="empty")
assert (
"Secrets Manager can't find the specified secret value for staging label: AWSCURRENT"
== ve.value.response["Error"]["Message"])
== ce.value.response["Error"]["Message"])


@mock.patch("zdatasets.utils.secret_fetcher.get_current_namespace")
Expand Down

0 comments on commit 1b3d8c4

Please sign in to comment.