Skip to content

Commit feb8001

Browse files
nqnkxtran
andauthored
[ENG-856] Remove large file from repo (#187)
* Remove large file from repo * Styling * Remove large image file and update test --------- Co-authored-by: Kim Tran <ksprtran@gmail.com>
1 parent 2e30886 commit feb8001

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

tests/large_image.png

-14.8 MB
Binary file not shown.

tests/test_magentic.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from typing import Literal
23

34
import openai
@@ -188,14 +189,22 @@ async def _generate_title_and_description(query: str, widget_data: str) -> Widge
188189
).assert_function_call_response()
189190

190191

191-
@pytest.mark.async_client
192-
@pytest.mark.widget
193-
@pytest.mark.asyncio(scope="module")
194-
async def test_large_image_upload(session, magentic_model):
192+
@pytest.mark.vision
193+
def test_large_image_upload(session):
194+
# If large_image.png doesn't exist, download it from https://log10py-public.s3.us-east-2.amazonaws.com/large_image.png
195+
if not os.path.exists("./tests/large_image.png"):
196+
import requests
197+
198+
url = "https://log10py-public.s3.us-east-2.amazonaws.com/large_image.png"
199+
response = requests.get(url)
200+
with open("./tests/large_image.png", "wb") as f:
201+
f.write(response.content)
202+
195203
with open("./tests/large_image.png", "rb") as f:
196204
image_bytes = f.read()
197205

198206
@chatprompt(SystemMessage("What's in the following screenshot?"), UserImageMessage(image_bytes))
199207
def _llm() -> str: ...
200208

201-
_llm()
209+
output = _llm()
210+
assert isinstance(output, str)

0 commit comments

Comments
 (0)