Commit f7f512d 1 parent 8f9242e commit f7f512d Copy full SHA for f7f512d
File tree 1 file changed +7
-4
lines changed
llama-index-core/tests/multi_modal_llms
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ def test_image_documents_to_base64_multiple_sources():
61
61
]
62
62
with patch ("requests.get" ) as mock_get :
63
63
mock_get .return_value .content = EXP_BINARY
64
- with patch ("builtins.open" , mock_open (read_data = EXP_BINARY )):
65
- result = image_documents_to_base64 (documents )
64
+ with patch ("os.path.isfile" , return_value = True ):
65
+ with patch ("builtins.open" , mock_open (read_data = EXP_BINARY )):
66
+ result = image_documents_to_base64 (documents )
66
67
67
68
assert len (result ) == 4
68
69
assert all (encoding == EXP_BASE64 for encoding in result )
@@ -144,8 +145,10 @@ def test_set_base64_and_mimetype_for_image_docs():
144
145
145
146
with patch ("requests.get" ) as mock_get :
146
147
mock_get .return_value .content = EXP_BINARY
147
- with patch ("builtins.open" , mock_open (read_data = EXP_BINARY )):
148
- results = set_base64_and_mimetype_for_image_docs (image_docs )
148
+ # patch os.path.isfile
149
+ with patch ("os.path.isfile" , return_value = True ):
150
+ with patch ("builtins.open" , mock_open (read_data = EXP_BINARY )):
151
+ results = set_base64_and_mimetype_for_image_docs (image_docs )
149
152
150
153
assert len (results ) == 2
151
154
assert results [0 ].image == EXP_BASE64
You can’t perform that action at this time.
0 commit comments