Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KsenijaS committed May 3, 2024
1 parent 2febc40 commit aa21294
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/unittests/sources/azure/test_imds.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,21 +239,13 @@ def test_basic_fallback(
),
]

headers = wrapped_readurl.mock_calls[0].kwargs
if isinstance(headers, tuple):
_, headers_cb, _ = wrapped_readurl.mock_calls[0].kwargs
else:
headers_cb = headers["headers_cb"]
headers = headers_cb(None)
assert list(headers.keys()) == ["Metadata", "x-ms-client-request-id"]
assert headers.get("Metadata") == "true"

assert caplog.record_tuples == [
(
"cloudinit.url_helper",
logging.DEBUG,
StringMatch(
r"\[0/infinite\] open.*[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-"
r"\[0/infinite\] open.*Metadata.*true"
".*x-ms-client-request-id.*[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-"
"[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}.*"
),
),
Expand Down

0 comments on commit aa21294

Please sign in to comment.