Skip to content

Commit 8d01088

Browse files
fix windows tests
1 parent 1742e6a commit 8d01088

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
with_user_agent_extra)
1313
from databricks.sdk.version import __version__
1414

15-
from .conftest import noop_credentials, set_az_path
15+
from .conftest import noop_credentials, set_az_path, set_home
1616

1717
__tests__ = os.path.dirname(__file__)
1818

@@ -471,23 +471,23 @@ def test_disable_oauth_refresh_token_defaults_to_false(mocker):
471471
def test_config_file_scopes_empty_defaults_to_all_apis(monkeypatch, mocker):
472472
"""Test that empty scopes in config file defaults to all-apis."""
473473
mocker.patch("databricks.sdk.config.Config.init_auth")
474-
monkeypatch.setenv("HOME", str(pathlib.Path(__tests__) / "testdata"))
474+
set_home(monkeypatch, "/testdata")
475475
config = Config(profile="scope-empty")
476476
assert config.get_scopes() == ["all-apis"]
477477

478478

479479
def test_config_file_scopes_single(monkeypatch, mocker):
480480
"""Test single scope from config file."""
481481
mocker.patch("databricks.sdk.config.Config.init_auth")
482-
monkeypatch.setenv("HOME", str(pathlib.Path(__tests__) / "testdata"))
482+
set_home(monkeypatch, "/testdata")
483483
config = Config(profile="scope-single")
484484
assert config.get_scopes() == ["clusters"]
485485

486486

487487
def test_config_file_scopes_multiple_sorted(monkeypatch, mocker):
488488
"""Test multiple scopes from config file are sorted."""
489489
mocker.patch("databricks.sdk.config.Config.init_auth")
490-
monkeypatch.setenv("HOME", str(pathlib.Path(__tests__) / "testdata"))
490+
set_home(monkeypatch, "/testdata")
491491
config = Config(profile="scope-multiple")
492492
# Should be sorted alphabetically
493493
expected = ["clusters", "files:read", "iam:read", "jobs", "mlflow", "model-serving:read", "pipelines"]

0 commit comments

Comments
 (0)