Skip to content

Commit

Permalink
fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Jul 18, 2024
1 parent 825e144 commit be5edea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from databricks.sdk.config import Config, with_product, with_user_agent_extra
from databricks.sdk.version import __version__

from .conftest import noop_credentials
from .conftest import noop_credentials, set_az_path

__tests__ = os.path.dirname(__file__)

Expand Down Expand Up @@ -80,23 +80,23 @@ def test_config_copy_deep_copies_user_agent_other_info(config):


def test_load_azure_tenant_id_404(requests_mock, monkeypatch):
monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin')
set_az_path(monkeypatch)
mock = requests_mock.get('https://abc123.azuredatabricks.net/aad/auth', status_code=404)
cfg = Config(host="https://abc123.azuredatabricks.net")
assert cfg.azure_tenant_id is None
assert mock.called_once


def test_load_azure_tenant_id_no_location_header(requests_mock, monkeypatch):
monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin')
set_az_path(monkeypatch)
mock = requests_mock.get('https://abc123.azuredatabricks.net/aad/auth', status_code=302)
cfg = Config(host="https://abc123.azuredatabricks.net")
assert cfg.azure_tenant_id is None
assert mock.called_once


def test_load_azure_tenant_id_unparsable_location_header(requests_mock, monkeypatch):
monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin')
set_az_path(monkeypatch)
mock = requests_mock.get('https://abc123.azuredatabricks.net/aad/auth',
status_code=302,
headers={'Location': 'https://unexpected-location'})
Expand All @@ -106,7 +106,7 @@ def test_load_azure_tenant_id_unparsable_location_header(requests_mock, monkeypa


def test_load_azure_tenant_id_happy_path(requests_mock, monkeypatch):
monkeypatch.setenv('PATH', __tests__ + '/testdata:/bin')
set_az_path(monkeypatch)
mock = requests_mock.get(
'https://abc123.azuredatabricks.net/aad/auth',
status_code=302,
Expand Down

0 comments on commit be5edea

Please sign in to comment.