mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
fix tests
This commit is contained in:
parent
b232a6c04d
commit
e3733a235d
@ -563,7 +563,7 @@ class AsyncClient(BaseClient):
|
||||
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
|
||||
|
||||
|
||||
@ -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('/'))
|
||||
|
||||
@ -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('/'))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user