Skip to content

Commit

Permalink
attempt to fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wj-chen committed Jul 26, 2023
1 parent 946c63a commit a7b6f3b
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions tests/test__cloud_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def test_get_application_default_credentials_path(get_config_dir):

def test_get_gcloud_config_path_env_var(monkeypatch):
config_path_sentinel = "config_path"
monkeypatch.setenv(environment_vars.CLOUD_SDK_CONFIG_DIR, config_path_sentinel)
monkeypatch.setenv(
environment_vars.CLOUD_SDK_CONFIG_DIR,
config_path_sentinel)
config_path = _cloud_sdk.get_gcloud_config_path()
assert config_path == config_path_sentinel

Expand All @@ -125,7 +127,10 @@ def test_get_gcloud_config_path_unix(expanduser):

config_path = _cloud_sdk.get_gcloud_config_path()

assert os.path.split(config_path) == ("~/.config", _cloud_sdk._CONFIG_DIRECTORY_GCLOUD)
assert os.path.split(config_path) == (
"~/.config",
_cloud_sdk._CONFIG_DIRECTORY_GCLOUD,
)


@mock.patch("os.name", new="nt")
Expand All @@ -135,7 +140,9 @@ def test_get_gcloud_config_path_windows(monkeypatch):

config_path = _cloud_sdk.get_gcloud_config_path()

assert os.path.split(config_path) == (appdata, _cloud_sdk._CONFIG_DIRECTORY_GCLOUD)
assert os.path.split(config_path) == (
appdata,
_cloud_sdk._CONFIG_DIRECTORY_GCLOUD)


@mock.patch("os.name", new="nt")
Expand All @@ -145,12 +152,16 @@ def test_get_gcloud_config_path_no_appdata(monkeypatch):

config_path = _cloud_sdk.get_gcloud_config_path()

assert os.path.split(config_path) == ("G:/\\", _cloud_sdk._CONFIG_DIRECTORY_GCLOUD)
assert os.path.split(config_path) == (
"G:/\\",
_cloud_sdk._CONFIG_DIRECTORY_GCLOUD)


def test_get_bq_config_path_env_var(monkeypatch):
config_path_sentinel = "config_path"
monkeypatch.setenv(environment_vars.CLOUD_SDK_CONFIG_DIR, config_path_sentinel)
monkeypatch.setenv(
environment_vars.CLOUD_SDK_CONFIG_DIR,
config_path_sentinel)
config_path = _cloud_sdk.get_bq_config_path()
assert config_path == config_path_sentinel

Expand All @@ -161,7 +172,9 @@ def test_get_bq_config_path_unix(expanduser):

config_path = _cloud_sdk.get_bq_config_path()

assert os.path.split(config_path) == ("~/.config", _cloud_sdk._CONFIG_DIRECTORY_BQ)
assert os.path.split(config_path) == (
"~/.config",
_cloud_sdk._CONFIG_DIRECTORY_BQ)


@mock.patch("os.name", new="nt")
Expand All @@ -171,7 +184,9 @@ def test_get_bq_config_path_windows(monkeypatch):

config_path = _cloud_sdk.get_bq_config_path()

assert os.path.split(config_path) == (appdata, _cloud_sdk._CONFIG_DIRECTORY_BQ)
assert os.path.split(config_path) == (
appdata,
_cloud_sdk._CONFIG_DIRECTORY_BQ)


@mock.patch("os.name", new="nt")
Expand All @@ -181,7 +196,9 @@ def test_get_bq_config_path_no_appdata(monkeypatch):

config_path = _cloud_sdk.get_bq_config_path()

assert os.path.split(config_path) == ("G:/\\", _cloud_sdk._CONFIG_DIRECTORY_BQ)
assert os.path.split(config_path) == (
"G:/\\",
_cloud_sdk._CONFIG_DIRECTORY_BQ)


@mock.patch("os.name", new="nt")
Expand Down

0 comments on commit a7b6f3b

Please sign in to comment.