chore: add tests for checking SHA in blob request (#425)

This commit is contained in:
Parth Sareen
2025-01-21 10:20:11 -08:00
committed by GitHub
parent 7e64093df0
commit 0561f42701
+3 -2
View File
@@ -1,6 +1,7 @@
import base64 import base64
import json import json
import os import os
import re
import tempfile import tempfile
from pathlib import Path from pathlib import Path
@@ -618,7 +619,7 @@ def test_client_create_from_library(httpserver: HTTPServer):
def test_client_create_blob(httpserver: HTTPServer): def test_client_create_blob(httpserver: HTTPServer):
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='POST').respond_with_response(Response(status=201)) httpserver.expect_ordered_request(re.compile('^/api/blobs/sha256[:-][0-9a-fA-F]{64}$'), method='POST').respond_with_response(Response(status=201))
client = Client(httpserver.url_for('/')) client = Client(httpserver.url_for('/'))
@@ -1009,7 +1010,7 @@ async def test_async_client_create_from_library(httpserver: HTTPServer):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_async_client_create_blob(httpserver: HTTPServer): async def test_async_client_create_blob(httpserver: HTTPServer):
httpserver.expect_ordered_request(PrefixPattern('/api/blobs/'), method='POST').respond_with_response(Response(status=201)) httpserver.expect_ordered_request(re.compile('^/api/blobs/sha256[:-][0-9a-fA-F]{64}$'), method='POST').respond_with_response(Response(status=201))
client = AsyncClient(httpserver.url_for('/')) client = AsyncClient(httpserver.url_for('/'))