From ffded167d202ecacf9f00732986b65fec7f11dda Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Wed, 31 Jan 2024 21:58:38 -0500 Subject: [PATCH] Test error on missing key --- tests/test_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index de91c946..c5cd0109 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -30,6 +30,11 @@ def test_api_key_from_env(self): ) self.assertTrue("got 'Bearer WHATEVER'" in str(mc.exception)) + def test_api_key_missing(self): + with self.assertRaises(ValueError) as mc: + client = Client() + self.assertEqual(str(mc.exception), "api_key is required") + def test_create_one_task_pickle(self): results = self.client.create_tasks( [TaskInput(coroutine_uri="my-cool-coroutine", input=42)]