Skip to content

Commit 0cc0b29

Browse files
committed
fix(tests): handle stdlib json spacing in createdAt regex
SDK sends request bodies via stdlib json.dumps which produces "createdAt": "..." (with space), while orjson produces "createdAt":"..." (no space). Handle both formats plus YAML. risk: low
1 parent 2620115 commit 0cc0b29

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/tests-support/src/tests_support/vcrpy_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161

6262
# --- Timestamp normalization ---
6363
_CREATED_AT_RE = re.compile(
64-
r'(?<=createdAt":")\d{4}-\d{2}-\d{2} \d{2}:\d{2}' # JSON (orjson): "createdAt":"..."
64+
r'(?<=createdAt": ")\d{4}-\d{2}-\d{2} \d{2}:\d{2}' # JSON (stdlib): "createdAt": "..."
65+
r"|"
66+
r'(?<=createdAt":")\d{4}-\d{2}-\d{2} \d{2}:\d{2}' # JSON (orjson): "createdAt":"..."
6567
r"|"
6668
r"(?<=createdAt: )\d{4}-\d{2}-\d{2} \d{2}:\d{2}" # YAML: createdAt: ...
6769
)

0 commit comments

Comments
 (0)