Skip to content

Commit a4c6b9d

Browse files
sfc-gh-fpawlowskisfc-gh-pczajka
authored andcommitted
[Async] #2183 Tests async migrated to synch wiremock mappings
1 parent 7d41275 commit a4c6b9d

File tree

6 files changed

+11
-198
lines changed

6 files changed

+11
-198
lines changed

test/data/wiremock/mappings/auth/pat/invalid_token.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
},
2323
"response": {
2424
"status": 200,
25+
"headers": {
26+
"Content-Type": "application/json"
27+
},
2528
"jsonBody": {
2629
"data": {
2730
"nextAction": "RETRY_LOGIN",

test/data/wiremock/mappings/auth/pat/invalid_token_async.json

Lines changed: 0 additions & 45 deletions
This file was deleted.

test/data/wiremock/mappings/auth/pat/successful_flow.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"method": "POST",
1010
"bodyPatterns": [
1111
{
12-
"equalToJson" : {
12+
"equalToJson": {
1313
"data": {
1414
"LOGIN_NAME": "testUser",
1515
"AUTHENTICATOR": "PROGRAMMATIC_ACCESS_TOKEN",
1616
"TOKEN": "some PAT"
1717
}
1818
},
19-
"ignoreExtraElements" : true
19+
"ignoreExtraElements": true
2020
},
2121
{
2222
"matchesJsonPath": {
@@ -28,6 +28,9 @@
2828
},
2929
"response": {
3030
"status": 200,
31+
"headers": {
32+
"Content-Type": "application/json"
33+
},
3134
"jsonBody": {
3235
"data": {
3336
"masterToken": "master token",

test/data/wiremock/mappings/auth/pat/successful_flow_async.json

Lines changed: 0 additions & 76 deletions
This file was deleted.

test/data/wiremock/mappings/auth/pat/successful_flow_password_async.json

Lines changed: 0 additions & 70 deletions
This file was deleted.

test/unit/aio/test_programmatic_access_token_async.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def test_valid_pat_async(wiremock_client: WiremockClient) -> None:
4646
/ "generic"
4747
)
4848

49-
wiremock_client.import_mapping(wiremock_data_dir / "successful_flow_async.json")
49+
wiremock_client.import_mapping(wiremock_data_dir / "successful_flow.json")
5050
wiremock_client.add_mapping(
5151
wiremock_generic_data_dir / "snowflake_disconnect_successful.json"
5252
)
@@ -75,7 +75,7 @@ async def test_invalid_pat_async(wiremock_client: WiremockClient) -> None:
7575
/ "auth"
7676
/ "pat"
7777
)
78-
wiremock_client.import_mapping(wiremock_data_dir / "invalid_token_async.json")
78+
wiremock_client.import_mapping(wiremock_data_dir / "invalid_token.json")
7979

8080
with pytest.raises(snowflake.connector.errors.DatabaseError) as execinfo:
8181
connection = SnowflakeConnection(
@@ -112,9 +112,7 @@ async def test_pat_as_password_async(wiremock_client: WiremockClient) -> None:
112112
/ "generic"
113113
)
114114

115-
wiremock_client.import_mapping(
116-
wiremock_data_dir / "successful_flow_password_async.json"
117-
)
115+
wiremock_client.import_mapping(wiremock_data_dir / "successful_flow.json")
118116
wiremock_client.add_mapping(
119117
wiremock_generic_data_dir / "snowflake_disconnect_successful.json"
120118
)

0 commit comments

Comments
 (0)