14
14
15
15
import pytest
16
16
17
+ from tests .unit .oauth_test_utils import SERVER_ADDRESS
17
18
18
- @pytest .fixture (scope = "session" )
19
+
20
+ @pytest .fixture
19
21
def sample_post_response_data ():
20
22
"""
21
23
This is the response to the first HTTP request (a POST) from an actual
@@ -38,10 +40,10 @@ def sample_post_response_data():
38
40
"""
39
41
40
42
yield {
41
- "nextUri" : "https://coordinator :8080/v1/statement/20210817_140827_00000_arvdv/1" ,
43
+ "nextUri" : f" { SERVER_ADDRESS } :8080/v1/statement/20210817_140827_00000_arvdv/1" ,
42
44
"id" : "20210817_140827_00000_arvdv" ,
43
45
"taskDownloadUris" : [],
44
- "infoUri" : "https://coordinator :8080/query.html?20210817_140827_00000_arvdv" ,
46
+ "infoUri" : f" { SERVER_ADDRESS } :8080/query.html?20210817_140827_00000_arvdv" ,
45
47
"stats" : {
46
48
"scheduled" : False ,
47
49
"runningSplits" : 0 ,
@@ -60,7 +62,7 @@ def sample_post_response_data():
60
62
}
61
63
62
64
63
- @pytest .fixture ( scope = "session" )
65
+ @pytest .fixture
64
66
def sample_get_response_data ():
65
67
"""
66
68
This is the response to the second HTTP request (a GET) from an actual
@@ -73,7 +75,7 @@ def sample_get_response_data():
73
75
"""
74
76
yield {
75
77
"id" : "20210817_140827_00000_arvdv" ,
76
- "nextUri" : "coordinator :8080/v1/statement/20210817_140827_00000_arvdv/2" ,
78
+ "nextUri" : f" { SERVER_ADDRESS } :8080/v1/statement/20210817_140827_00000_arvdv/2" ,
77
79
"data" : [
78
80
["UUID-0" , "http://worker0:8080" , "0.157" , False , "active" ],
79
81
["UUID-1" , "http://worker1:8080" , "0.157" , False , "active" ],
@@ -132,7 +134,7 @@ def sample_get_response_data():
132
134
},
133
135
],
134
136
"taskDownloadUris" : [],
135
- "partialCancelUri" : "http://localhost :8080/v1/stage/20210817_140827_00000_arvdv.0" , # NOQA: E501
137
+ "partialCancelUri" : f" { SERVER_ADDRESS } :8080/v1/stage/20210817_140827_00000_arvdv.0" , # NOQA: E501
136
138
"stats" : {
137
139
"nodes" : 2 ,
138
140
"processedBytes" : 880 ,
@@ -181,11 +183,11 @@ def sample_get_response_data():
181
183
"queuedSplits" : 0 ,
182
184
"wallTimeMillis" : 36 ,
183
185
},
184
- "infoUri" : "http://coordinator :8080/query.html?20210817_140827_00000_arvdv" , # NOQA: E501
186
+ "infoUri" : f" { SERVER_ADDRESS } :8080/query.html?20210817_140827_00000_arvdv" , # NOQA: E501
185
187
}
186
188
187
189
188
- @pytest .fixture ( scope = "session" )
190
+ @pytest .fixture
189
191
def sample_get_error_response_data ():
190
192
yield {
191
193
"error" : {
@@ -195,8 +197,7 @@ def sample_get_error_response_data():
195
197
"errorType" : "USER_ERROR" ,
196
198
"failureInfo" : {
197
199
"errorLocation" : {"columnNumber" : 15 , "lineNumber" : 1 },
198
- "message" : "line 1:15: Schema must be specified "
199
- "when session schema is not set" ,
200
+ "message" : "line 1:15: Schema must be specified when session schema is not set" ,
200
201
"stack" : [
201
202
"io.trino.sql.analyzer.SemanticExceptions.semanticException(SemanticExceptions.java:48)" ,
202
203
"io.trino.sql.analyzer.SemanticExceptions.semanticException(SemanticExceptions.java:43)" ,
@@ -241,7 +242,7 @@ def sample_get_error_response_data():
241
242
"message" : "line 1:15: Schema must be specified when session schema is not set" ,
242
243
},
243
244
"id" : "20210817_140827_00000_arvdv" ,
244
- "infoUri" : "http://localhost :8080/query.html?20210817_140827_00000_arvdv" ,
245
+ "infoUri" : f" { SERVER_ADDRESS } :8080/query.html?20210817_140827_00000_arvdv" ,
245
246
"stats" : {
246
247
"completedSplits" : 0 ,
247
248
"cpuTimeMillis" : 0 ,
0 commit comments