Skip to content

Commit

Permalink
chore: add tests for checking SHA in blob request (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthSareen authored Jan 21, 2025
1 parent 7e64093 commit 0561f42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import base64
import json
import os
import re
import tempfile
from pathlib import Path

Expand Down Expand Up @@ -618,7 +619,7 @@ def test_client_create_from_library(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('/'))

Expand Down Expand Up @@ -1009,7 +1010,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='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('/'))

Expand Down

0 comments on commit 0561f42

Please sign in to comment.