|
12 | 12 | with_user_agent_extra) |
13 | 13 | from databricks.sdk.version import __version__ |
14 | 14 |
|
15 | | -from .conftest import noop_credentials, set_az_path |
| 15 | +from .conftest import noop_credentials, set_az_path, set_home |
16 | 16 |
|
17 | 17 | __tests__ = os.path.dirname(__file__) |
18 | 18 |
|
@@ -471,23 +471,23 @@ def test_disable_oauth_refresh_token_defaults_to_false(mocker): |
471 | 471 | def test_config_file_scopes_empty_defaults_to_all_apis(monkeypatch, mocker): |
472 | 472 | """Test that empty scopes in config file defaults to all-apis.""" |
473 | 473 | mocker.patch("databricks.sdk.config.Config.init_auth") |
474 | | - monkeypatch.setenv("HOME", str(pathlib.Path(__tests__) / "testdata")) |
| 474 | + set_home(monkeypatch, "/testdata") |
475 | 475 | config = Config(profile="scope-empty") |
476 | 476 | assert config.get_scopes() == ["all-apis"] |
477 | 477 |
|
478 | 478 |
|
479 | 479 | def test_config_file_scopes_single(monkeypatch, mocker): |
480 | 480 | """Test single scope from config file.""" |
481 | 481 | mocker.patch("databricks.sdk.config.Config.init_auth") |
482 | | - monkeypatch.setenv("HOME", str(pathlib.Path(__tests__) / "testdata")) |
| 482 | + set_home(monkeypatch, "/testdata") |
483 | 483 | config = Config(profile="scope-single") |
484 | 484 | assert config.get_scopes() == ["clusters"] |
485 | 485 |
|
486 | 486 |
|
487 | 487 | def test_config_file_scopes_multiple_sorted(monkeypatch, mocker): |
488 | 488 | """Test multiple scopes from config file are sorted.""" |
489 | 489 | mocker.patch("databricks.sdk.config.Config.init_auth") |
490 | | - monkeypatch.setenv("HOME", str(pathlib.Path(__tests__) / "testdata")) |
| 490 | + set_home(monkeypatch, "/testdata") |
491 | 491 | config = Config(profile="scope-multiple") |
492 | 492 | # Should be sorted alphabetically |
493 | 493 | expected = ["clusters", "files:read", "iam:read", "jobs", "mlflow", "model-serving:read", "pipelines"] |
|
0 commit comments