Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceMacD committed Jan 12, 2024
1 parent b232a6c commit e3733a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ollama/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ async def upload_bytes():
break
yield chunk

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

return digest

Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def test_client_create_from_library(httpserver: HTTPServer):

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

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

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

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

Expand Down

0 comments on commit e3733a2

Please sign in to comment.