Skip to content

Commit e3733a2

Browse files
committed
fix tests
1 parent b232a6c commit e3733a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ollama/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ async def upload_bytes():
563563
break
564564
yield chunk
565565

566-
await self._request('PUT', f'/api/blobs/{digest}', content=upload_bytes())
566+
await self._request('POST', f'/api/blobs/{digest}', content=upload_bytes())
567567

568568
return digest
569569

tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def test_client_create_from_library(httpserver: HTTPServer):
418418

419419
def test_client_create_blob(httpserver: HTTPServer):
420420
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='HEAD').respond_with_response(Response(status=404))
421-
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='PUT').respond_with_response(Response(status=201))
421+
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='POST').respond_with_response(Response(status=201))
422422

423423
client = Client(httpserver.url_for('/'))
424424

@@ -759,7 +759,7 @@ async def test_async_client_create_from_library(httpserver: HTTPServer):
759759
@pytest.mark.asyncio
760760
async def test_async_client_create_blob(httpserver: HTTPServer):
761761
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='HEAD').respond_with_response(Response(status=404))
762-
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='PUT').respond_with_response(Response(status=201))
762+
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='POST').respond_with_response(Response(status=201))
763763

764764
client = AsyncClient(httpserver.url_for('/'))
765765

0 commit comments

Comments
 (0)