@@ -70,49 +70,3 @@ def test_validate_raises_error_for_missing_image(self):
7070 )
7171 with pytest .raises (ValueError , match = "An image is required for this request." ):
7272 spec .validate (prompt = "" , encoded_image = "" , encoded_audio = "" , files = {})
73-
74- @pytest .mark .asyncio
75- async def test_probe_sends_request (self , httpx_mock ):
76- httpx_mock .add_response (
77- method = "POST" , url = "http://example.com" , status_code = 200
78- )
79- spec = LLMSpec (
80- method = "POST" ,
81- url = "http://example.com" ,
82- headers = {},
83- body = '{"prompt": "<<PROMPT>>"}' ,
84- )
85- response = await spec .probe (prompt = "test" )
86- assert response .status_code == 200
87-
88- @pytest .mark .asyncio
89- async def test_probe_with_files (self , httpx_mock ):
90- httpx_mock .add_response (
91- method = "POST" , url = "http://example.com" , status_code = 200
92- )
93- spec = LLMSpec (
94- method = "POST" ,
95- url = "http://example.com" ,
96- headers = {"Content-Type" : "multipart/form-data" },
97- body = '{"prompt": "<<PROMPT>>"}' ,
98- has_files = True ,
99- )
100- files = {"file" : ("filename.txt" , "file content" )}
101- response = await spec .probe (prompt = "test" , files = files )
102- assert response .status_code == 200
103-
104- @pytest .mark .asyncio
105- async def test_probe_with_image (self , httpx_mock ):
106- httpx_mock .add_response (
107- method = "POST" , url = "http://example.com" , status_code = 200
108- )
109- spec = LLMSpec (
110- method = "POST" ,
111- url = "http://example.com" ,
112- headers = {},
113- body = '{"image": "<<BASE64_IMAGE>>"}' ,
114- has_image = True ,
115- )
116- encoded_image = "base64encodedstring"
117- response = await spec .probe (prompt = "test" , encoded_image = encoded_image )
118- assert response .status_code == 200
0 commit comments