Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit601b08e

Browse files
committed
nit
1 parent3f7d476 commit601b08e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎tests/unit/test_auth.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
AzureOAuthEndpointCollection,
2525
)
2626
fromdatabricks.sql.auth.authenticatorsimportCredentialsProvider,HeaderFactory
27+
fromdatabricks.sql.common.httpimportDatabricksHttpClient
2728
fromdatabricks.sql.experimental.oauth_persistenceimportOAuthPersistenceCache
2829

2930

@@ -248,8 +249,10 @@ def test_no_token_refresh__when_token_is_not_expired(
248249
assertmock_get_token.call_count==1
249250

250251
deftest_get_token_success(self,token_source,http_response):
251-
withpatch.object(token_source._http_client,"execute")asmock_execute:
252-
mock_execute.return_value=http_response(200)
252+
databricks_http_client=DatabricksHttpClient.get_instance()
253+
withpatch.object(
254+
databricks_http_client.session,"request",return_value=http_response(200)
255+
)asmock_request:
253256
token=token_source.get_token()
254257

255258
# Assert
@@ -259,8 +262,10 @@ def test_get_token_success(self, token_source, http_response):
259262
asserttoken.refresh_tokenisNone
260263

261264
deftest_get_token_failure(self,token_source,http_response):
262-
withpatch.object(token_source._http_client,"execute")asmock_execute:
263-
mock_execute.return_value=http_response(400)
265+
databricks_http_client=DatabricksHttpClient.get_instance()
266+
withpatch.object(
267+
databricks_http_client.session,"request",return_value=http_response(400)
268+
)asmock_request:
264269
withpytest.raises(Exception)ase:
265270
token_source.get_token()
266271
assert"Failed to get token: 400"instr(e.value)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp