1414
1515import pytest
1616
17+ from tests .unit .oauth_test_utils import SERVER_ADDRESS
1718
18- @pytest .fixture (scope = "session" )
19+
20+ @pytest .fixture
1921def sample_post_response_data ():
2022 """
2123 This is the response to the first HTTP request (a POST) from an actual
@@ -38,10 +40,10 @@ def sample_post_response_data():
3840 """
3941
4042 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" ,
4244 "id" : "20210817_140827_00000_arvdv" ,
4345 "taskDownloadUris" : [],
44- "infoUri" : "https://coordinator :8080/query.html?20210817_140827_00000_arvdv" ,
46+ "infoUri" : f" { SERVER_ADDRESS } :8080/query.html?20210817_140827_00000_arvdv" ,
4547 "stats" : {
4648 "scheduled" : False ,
4749 "runningSplits" : 0 ,
@@ -60,7 +62,7 @@ def sample_post_response_data():
6062 }
6163
6264
63- @pytest .fixture ( scope = "session" )
65+ @pytest .fixture
6466def sample_get_response_data ():
6567 """
6668 This is the response to the second HTTP request (a GET) from an actual
@@ -73,7 +75,7 @@ def sample_get_response_data():
7375 """
7476 yield {
7577 "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" ,
7779 "data" : [
7880 ["UUID-0" , "http://worker0:8080" , "0.157" , False , "active" ],
7981 ["UUID-1" , "http://worker1:8080" , "0.157" , False , "active" ],
@@ -132,7 +134,7 @@ def sample_get_response_data():
132134 },
133135 ],
134136 "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
136138 "stats" : {
137139 "nodes" : 2 ,
138140 "processedBytes" : 880 ,
@@ -181,11 +183,11 @@ def sample_get_response_data():
181183 "queuedSplits" : 0 ,
182184 "wallTimeMillis" : 36 ,
183185 },
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
185187 }
186188
187189
188- @pytest .fixture ( scope = "session" )
190+ @pytest .fixture
189191def sample_get_error_response_data ():
190192 yield {
191193 "error" : {
@@ -195,8 +197,7 @@ def sample_get_error_response_data():
195197 "errorType" : "USER_ERROR" ,
196198 "failureInfo" : {
197199 "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" ,
200201 "stack" : [
201202 "io.trino.sql.analyzer.SemanticExceptions.semanticException(SemanticExceptions.java:48)" ,
202203 "io.trino.sql.analyzer.SemanticExceptions.semanticException(SemanticExceptions.java:43)" ,
@@ -241,7 +242,7 @@ def sample_get_error_response_data():
241242 "message" : "line 1:15: Schema must be specified when session schema is not set" ,
242243 },
243244 "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" ,
245246 "stats" : {
246247 "completedSplits" : 0 ,
247248 "cpuTimeMillis" : 0 ,
0 commit comments