@@ -112,40 +112,79 @@ def test_get_application_default_credentials_path(get_config_dir):
112112 )
113113
114114
115- def test_get_config_path_env_var (monkeypatch ):
115+ def test_get_gcloud_config_path_env_var (monkeypatch ):
116116 config_path_sentinel = "config_path"
117117 monkeypatch .setenv (environment_vars .CLOUD_SDK_CONFIG_DIR , config_path_sentinel )
118- config_path = _cloud_sdk .get_config_path ()
118+ config_path = _cloud_sdk .get_gcloud_config_path ()
119119 assert config_path == config_path_sentinel
120120
121121
122122@mock .patch ("os.path.expanduser" )
123- def test_get_config_path_unix (expanduser ):
123+ def test_get_gcloud_config_path_unix (expanduser ):
124124 expanduser .side_effect = lambda path : path
125125
126- config_path = _cloud_sdk .get_config_path ()
126+ config_path = _cloud_sdk .get_gcloud_config_path ()
127127
128- assert os .path .split (config_path ) == ("~/.config" , _cloud_sdk ._CONFIG_DIRECTORY )
128+ assert os .path .split (config_path ) == (
129+ "~/.config" ,
130+ _cloud_sdk ._CONFIG_DIRECTORY_GCLOUD ,
131+ )
132+
133+
134+ @mock .patch ("os.name" , new = "nt" )
135+ def test_get_gcloud_config_path_windows (monkeypatch ):
136+ appdata = "appdata"
137+ monkeypatch .setenv (_cloud_sdk ._WINDOWS_CONFIG_ROOT_ENV_VAR , appdata )
138+
139+ config_path = _cloud_sdk .get_gcloud_config_path ()
140+
141+ assert os .path .split (config_path ) == (appdata , _cloud_sdk ._CONFIG_DIRECTORY_GCLOUD )
142+
143+
144+ @mock .patch ("os.name" , new = "nt" )
145+ def test_get_gcloud_config_path_no_appdata (monkeypatch ):
146+ monkeypatch .delenv (_cloud_sdk ._WINDOWS_CONFIG_ROOT_ENV_VAR , raising = False )
147+ monkeypatch .setenv ("SystemDrive" , "G:" )
148+
149+ config_path = _cloud_sdk .get_gcloud_config_path ()
150+
151+ assert os .path .split (config_path ) == ("G:/\\ " , _cloud_sdk ._CONFIG_DIRECTORY_GCLOUD )
152+
153+
154+ def test_get_bq_config_path_env_var (monkeypatch ):
155+ config_path_sentinel = "config_path"
156+ monkeypatch .setenv (environment_vars .CLOUD_SDK_CONFIG_DIR , config_path_sentinel )
157+ config_path = _cloud_sdk .get_bq_config_path ()
158+ assert config_path == config_path_sentinel
159+
160+
161+ @mock .patch ("os.path.expanduser" )
162+ def test_get_bq_config_path_unix (expanduser ):
163+ expanduser .side_effect = lambda path : path
164+
165+ config_path = _cloud_sdk .get_bq_config_path ()
166+
167+ assert os .path .split (config_path ) == ("~/.config" , _cloud_sdk ._CONFIG_DIRECTORY_BQ )
129168
130169
131170@mock .patch ("os.name" , new = "nt" )
132- def test_get_config_path_windows (monkeypatch ):
171+ def test_get_bq_config_path_windows (monkeypatch ):
133172 appdata = "appdata"
134173 monkeypatch .setenv (_cloud_sdk ._WINDOWS_CONFIG_ROOT_ENV_VAR , appdata )
135174
136- config_path = _cloud_sdk .get_config_path ()
175+ config_path = _cloud_sdk .get_bq_config_path ()
137176
138- assert os .path .split (config_path ) == (appdata , _cloud_sdk ._CONFIG_DIRECTORY )
177+ assert os .path .split (config_path ) == (appdata , _cloud_sdk ._CONFIG_DIRECTORY_BQ )
139178
140179
141180@mock .patch ("os.name" , new = "nt" )
142- def test_get_config_path_no_appdata (monkeypatch ):
181+ def test_get_bq_config_path_no_appdata (monkeypatch ):
143182 monkeypatch .delenv (_cloud_sdk ._WINDOWS_CONFIG_ROOT_ENV_VAR , raising = False )
144183 monkeypatch .setenv ("SystemDrive" , "G:" )
145184
146- config_path = _cloud_sdk .get_config_path ()
185+ config_path = _cloud_sdk .get_bq_config_path ()
147186
148- assert os .path .split (config_path ) == ("G:/\\ " , _cloud_sdk ._CONFIG_DIRECTORY )
187+ assert os .path .split (config_path ) == ("G:/\\ " , _cloud_sdk ._CONFIG_DIRECTORY_BQ )
149188
150189
151190@mock .patch ("os.name" , new = "nt" )
0 commit comments