From 2a159ad923ca35bbfcaf516b85eae36328ce6098 Mon Sep 17 00:00:00 2001 From: Jakob Keller <57402305+jakob-keller@users.noreply.github.com> Date: Sun, 18 Aug 2024 02:36:41 +0200 Subject: [PATCH] test error conditions of `client.get_waiter()` --- tests/test_client.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/test_client.py diff --git a/tests/test_client.py b/tests/test_client.py new file mode 100644 index 00000000..cd222a63 --- /dev/null +++ b/tests/test_client.py @@ -0,0 +1,19 @@ +import pytest + + +@pytest.mark.moto +def test_get_waiter_not_supported_by_service(sns_client): + waiter_name = 'sns_does_not_support_waiters' + with pytest.raises( + ValueError, match=f'Waiter does not exist: {waiter_name}' + ): + sns_client.get_waiter(waiter_name) + + +@pytest.mark.moto +def test_get_waiter_invalid_waiter_name(cloudformation_client): + waiter_name = 'this_name_is_invalid' + with pytest.raises( + ValueError, match=f'Waiter does not exist: {waiter_name}' + ): + cloudformation_client.get_waiter(waiter_name)