From e3123766a622b12da487673b861c19575eba50d2 Mon Sep 17 00:00:00 2001 From: evelynmitchell Date: Mon, 27 Nov 2023 18:40:10 -0700 Subject: [PATCH] rename function for f8 --- tests/models/test_ssd_1b.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/models/test_ssd_1b.py b/tests/models/test_ssd_1b.py index 7a7a897f..0ed89106 100644 --- a/tests/models/test_ssd_1b.py +++ b/tests/models/test_ssd_1b.py @@ -105,12 +105,20 @@ def test_ssd1b_generate_uuid(ssd1b_model): assert len(uuid_str) == 36 # UUID format -def test_ssd1b_rate_limited_call(ssd1b_model): +def test_ssd1b_rate_limited_call_connect(ssd1b_model): task = "A painting of a dog" image_url = ssd1b_model.rate_limited_call(task) assert isinstance(image_url, str) assert image_url.startswith("https://") +def test_ssd1b_rate_limited_call_ratelimit(ssd1b_model, mocker): + task = "A painting of a dog" + mocker.patch.object( + ssd1b_model, "__call__", side_effect=Exception("Rate limit exceeded") + ) + with pytest.raises(Exception, match="Rate limit exceeded"): + ssd1b_model.rate_limited_call(task) + # Test cases for additional scenarios and behaviors def test_ssd1b_dashboard_printing(ssd1b_model, capsys):