@@ -176,7 +176,7 @@ def test_identifier_for_url(identifier, expected):
176
176
assert identifier_for_url (identifier ) == expected
177
177
178
178
179
- @patch ("snowflake.cli._plugins.connection.util.get_account " )
179
+ @patch ("snowflake.cli._plugins.connection.util.get_account_name " )
180
180
@patch ("snowflake.cli._plugins.connection.util.get_context" )
181
181
@patch ("snowflake.cli._plugins.connection.util.get_snowsight_host" )
182
182
@pytest .mark .parametrize (
@@ -218,6 +218,27 @@ def test_make_snowsight_url(
218
218
assert actual == expected
219
219
220
220
221
+ @patch (
222
+ "snowflake.cli._plugins.connection.util.is_regionless_redirect" , return_value = False
223
+ )
224
+ @patch ("snowflake.cli._plugins.connection.util.get_region" , return_value = "x.y" )
225
+ @patch (
226
+ "snowflake.cli._plugins.connection.util.get_account_locator" ,
227
+ return_value = "account_locator" ,
228
+ )
229
+ @patch (
230
+ "snowflake.cli._plugins.connection.util.get_snowsight_host" ,
231
+ return_value = "https://test.snowsight.host" ,
232
+ )
233
+ def test_get_snowsight_host_with_account_locator (
234
+ get_snowsight_host , get_locator , get_region , is_regionless
235
+ ):
236
+ assert (
237
+ make_snowsight_url (None , "an/url/path" )
238
+ == "https://test.snowsight.host/x.y/account_locator/an/url/path"
239
+ )
240
+
241
+
221
242
@pytest .mark .parametrize (
222
243
"allowlist, expected" ,
223
244
[
@@ -286,8 +307,8 @@ def test_get_context_local_non_regionless_gets_local_region(
286
307
("org-acct.mydns.snowflakecomputing.com" , None ),
287
308
("account.x.us-west-2.aws.snowflakecomputing.com" , "x.us-west-2.aws" ),
288
309
("naf_test_pc.us-west-2.snowflakecomputing.com" , None ),
289
- ("test_account.az.int.snowflakecomputing.com" , None ),
290
- ("frozenweb.prod3.external-zone.snowflakecomputing.com" , None ),
310
+ ("test_account.az.int.snowflakecomputing.com" , "az.int" ),
311
+ ("frozenweb.prod3.external-zone.snowflakecomputing.com" , "prod3.external-zone" ),
291
312
],
292
313
)
293
314
def test_get_host_region (host , expected ):
0 commit comments