Skip to content

Commit 1659038

Browse files
adamtheturtleclaude
andcommitted
Bump vws-python-mock to 2026.2.22.2 and clean up path-prefix handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ec3c968 commit 1659038

4 files changed

Lines changed: 4 additions & 23 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ optional-dependencies.dev = [
8282
"ty==0.0.17",
8383
"types-requests==2.32.4.20260107",
8484
"vulture==2.14",
85-
"vws-python-mock==2026.2.22.1",
85+
"vws-python-mock==2026.2.22.2",
8686
"vws-test-fixtures==2023.3.5",
8787
"yamlfix==1.19.1",
8888
"zizmor==1.22.0",

src/vws/_vws_request.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
API.
33
"""
44

5-
from urllib.parse import urlparse
6-
75
import requests
86
from beartype import BeartypeConf, beartype
97
from vws_auth_tools import authorization_header, rfc_1123_date
@@ -47,17 +45,14 @@ def target_api_request(
4745
"""
4846
date_string = rfc_1123_date()
4947

50-
base_path = urlparse(url=base_vws_url).path.rstrip("/")
51-
full_request_path = base_path + request_path
52-
5348
signature_string = authorization_header(
5449
access_key=server_access_key,
5550
secret_key=server_secret_key,
5651
method=method,
5752
content=data,
5853
content_type=content_type,
5954
date=date_string,
60-
request_path=full_request_path,
55+
request_path=request_path,
6156
)
6257

6358
headers = {

src/vws/query.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import json
66
from http import HTTPMethod, HTTPStatus
77
from typing import Any, BinaryIO
8-
from urllib.parse import urlparse
98

109
import requests
1110
from beartype import BeartypeConf, beartype
@@ -127,9 +126,6 @@ def query(
127126
content, content_type_header = encode_multipart_formdata(fields=body)
128127
method = HTTPMethod.POST
129128

130-
base_path = urlparse(url=self._base_vwq_url).path.rstrip("/")
131-
full_request_path = base_path + request_path
132-
133129
authorization_string = authorization_header(
134130
access_key=self._client_access_key,
135131
secret_key=self._client_secret_key,
@@ -138,7 +134,7 @@ def query(
138134
# Note that this is not the actual Content-Type header value sent.
139135
content_type="multipart/form-data",
140136
date=date,
141-
request_path=full_request_path,
137+
request_path=request_path,
142138
)
143139

144140
headers = {

tests/test_vws.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tests for helper functions for managing a Vuforia database."""
22

33
import base64
4-
import contextlib
54
import datetime
65
import io
76
import secrets
@@ -16,7 +15,6 @@
1615

1716
from vws import VWS, CloudRecoService, VuMarkService
1817
from vws.exceptions.custom_exceptions import TargetProcessingTimeoutError
19-
from vws.exceptions.vws_exceptions import UnknownTargetError
2018
from vws.reports import (
2119
DatabaseSummaryReport,
2220
TargetRecord,
@@ -264,15 +262,7 @@ def test_custom_base_url_with_path_prefix() -> None:
264262
base_vws_url=base_vws_url,
265263
)
266264

267-
# MockVWS's path-length check in validate_target_id_exists
268-
# does not account for a base URL path prefix, so it
269-
# incorrectly treats the last path segment ("targets") as a
270-
# target ID and raises UnknownTargetError.
271-
# See https://github.com/VWS-Python/vws-python-mock/issues/2995
272-
# The request did reach MockVWS (proving the prefix was
273-
# preserved in the URL), so this exception is expected for now.
274-
with contextlib.suppress(UnknownTargetError):
275-
assert vws_client.list_targets() == []
265+
assert vws_client.list_targets() == []
276266

277267

278268
class TestListTargets:

0 commit comments

Comments
 (0)