Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KsenijaS committed Apr 29, 2024
1 parent 97eecd9 commit f679ef0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cloudinit/sources/azure/imds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# This file is part of cloud-init. See LICENSE file for license information.

import logging
import uuid
from time import time
from typing import Dict, Optional, Type, Union

import requests
import uuid

from cloudinit import util
from cloudinit.sources.helpers.azure import report_diagnostic_event
Expand Down
12 changes: 5 additions & 7 deletions tests/unittests/sources/azure/test_imds.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class TestFetchMetadataWithApiFallback:

# Early versions of responses do not appreciate the parameters...
base_url = "http://169.254.169.254/metadata/instance"
headers = {"Metadata": "true"}
timeout = 30

@pytest.mark.parametrize("retry_deadline", [0.0, 1.0, 60.0])
Expand Down Expand Up @@ -168,7 +167,7 @@ def test_basic(
mock.call(
self.default_url,
timeout=self.timeout,
headers=self.headers,
headers_cb=mock.ANY,
exception_cb=mock.ANY,
infinite=True,
log_req_resp=True,
Expand Down Expand Up @@ -213,15 +212,15 @@ def test_basic_fallback(
mock.call(
self.default_url,
timeout=self.timeout,
headers=self.headers,
headers_cb=mock.ANY,
exception_cb=mock.ANY,
infinite=True,
log_req_resp=True,
),
mock.call(
self.fallback_url,
timeout=self.timeout,
headers=self.headers,
headers_cb=mock.ANY,
exception_cb=mock.ANY,
infinite=True,
log_req_resp=True,
Expand Down Expand Up @@ -575,7 +574,7 @@ def test_non_json_repsonse(
mock.call(
self.default_url,
timeout=self.timeout,
headers=self.headers,
headers_cb=mock.ANY,
exception_cb=mock.ANY,
infinite=True,
log_req_resp=True,
Expand Down Expand Up @@ -639,7 +638,6 @@ class TestFetchReprovisionData:
"http://169.254.169.254/metadata/"
"reprovisiondata?api-version=2019-06-01"
)
headers = {"Metadata": "true"}
timeout = 30

# Early versions of responses do not appreciate the parameters...
Expand All @@ -663,7 +661,7 @@ def test_basic(
mock.call(
self.url,
timeout=self.timeout,
headers=self.headers,
headers_cb=mock.ANY,
exception_cb=mock.ANY,
infinite=True,
log_req_resp=False,
Expand Down

0 comments on commit f679ef0

Please sign in to comment.