@@ -83,16 +83,14 @@ def test_sx_adaptor_settings(caplog):
83
83
{
84
84
'type' : 'my-type' ,
85
85
'endpoint' : 'http://my-left-foot.com:5000' ,
86
- 'email' : 'thegoodplace@example.com' ,
87
- 'password' : 'forkingshirtballs' ,
86
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
88
87
}
89
88
]
90
89
x = ServiceXConfigAdaptor (c )
91
- endpoint , email , password = x .get_servicex_adaptor_config ('my-type' )
90
+ endpoint , token = x .get_servicex_adaptor_config ('my-type' )
92
91
93
92
assert endpoint == 'http://my-left-foot.com:5000'
94
- assert email == 'thegoodplace@example.com'
95
- assert password == 'forkingshirtballs'
93
+ assert token == 'forkingshirtballs.thegoodplace.bortles'
96
94
97
95
assert len (caplog .record_tuples ) == 0
98
96
@@ -106,16 +104,14 @@ def test_sx_adaptor_settings_no_backend_name_requested(caplog):
106
104
{
107
105
'type' : 'my-type' ,
108
106
'endpoint' : 'http://my-left-foot.com:5000' ,
109
- 'email' : 'thegoodplace@example.com' ,
110
- 'password' : 'forkingshirtballs' ,
107
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
111
108
}
112
109
]
113
110
x = ServiceXConfigAdaptor (c )
114
- endpoint , email , password = x .get_servicex_adaptor_config ()
111
+ endpoint , token = x .get_servicex_adaptor_config ()
115
112
116
113
assert endpoint == 'http://my-left-foot.com:5000'
117
- assert email == 'thegoodplace@example.com'
118
- assert password == 'forkingshirtballs'
114
+ assert token == 'forkingshirtballs.thegoodplace.bortles'
119
115
120
116
assert caplog .record_tuples [0 ][2 ] == "No backend type requested, " \
121
117
"using http://my-left-foot.com:5000 - please be " \
@@ -131,16 +127,14 @@ def test_sx_adaptor_settings_no_backend_name_requested_or_listed(caplog):
131
127
c ['api_endpoints' ] = [
132
128
{
133
129
'endpoint' : 'http://my-left-foot.com:5000' ,
134
- 'email' : 'thegoodplace@example.com' ,
135
- 'password' : 'forkingshirtballs' ,
130
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
136
131
}
137
132
]
138
133
x = ServiceXConfigAdaptor (c )
139
- endpoint , email , password = x .get_servicex_adaptor_config ()
134
+ endpoint , token = x .get_servicex_adaptor_config ()
140
135
141
136
assert endpoint == 'http://my-left-foot.com:5000'
142
- assert email == 'thegoodplace@example.com'
143
- assert password == 'forkingshirtballs'
137
+ assert token == 'forkingshirtballs.thegoodplace.bortles'
144
138
145
139
assert caplog .record_tuples [0 ][2 ] == "No backend type requested, " \
146
140
"using http://my-left-foot.com:5000 - please be " \
@@ -156,16 +150,14 @@ def test_sx_adaptor_settings_backend_name_requested_with_unlabeled_type(caplog):
156
150
c ['api_endpoints' ] = [
157
151
{
158
152
'endpoint' : 'http://my-left-foot.com:5000' ,
159
- 'email' : 'thegoodplace@example.com' ,
160
- 'password' : 'forkingshirtballs' ,
153
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
161
154
}
162
155
]
163
156
x = ServiceXConfigAdaptor (c )
164
- endpoint , email , password = x .get_servicex_adaptor_config ('xaod' )
157
+ endpoint , token = x .get_servicex_adaptor_config ('xaod' )
165
158
166
159
assert endpoint == 'http://my-left-foot.com:5000'
167
- assert email == 'thegoodplace@example.com'
168
- assert password == 'forkingshirtballs'
160
+ assert token == 'forkingshirtballs.thegoodplace.bortles'
169
161
170
162
assert caplog .record_tuples [0 ][2 ] == "No 'xaod' backend type found, " \
171
163
"using http://my-left-foot.com:5000 - please add to " \
@@ -180,22 +172,19 @@ def test_sx_adaptor_settings_backend_name_requested_after_labeled_type(caplog):
180
172
c ['api_endpoints' ] = [
181
173
{
182
174
'endpoint' : 'http://my-left-foot.com:5000' ,
183
- 'email' : 'thegoodplace@example.com' ,
184
- 'password' : 'forkingshirtballs' ,
175
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
185
176
},
186
177
{
187
178
'type' : 'xaod' ,
188
179
'endpoint' : 'http://my-left-foot.com:5001' ,
189
- 'email' : 'thegoodplace1@example.com' ,
190
- 'password' : 'forkingshirtballs1' ,
180
+ 'token' : 'forkingshirtballs.thegoodplace.bortles1'
191
181
}
192
182
]
193
183
x = ServiceXConfigAdaptor (c )
194
- endpoint , email , password = x .get_servicex_adaptor_config ('xaod' )
184
+ endpoint , token = x .get_servicex_adaptor_config ('xaod' )
195
185
196
186
assert endpoint == 'http://my-left-foot.com:5001'
197
- assert email == 'thegoodplace1@example.com'
198
- assert password == 'forkingshirtballs1'
187
+ assert token == 'forkingshirtballs.thegoodplace.bortles1'
199
188
200
189
assert len (caplog .record_tuples ) == 0
201
190
@@ -209,21 +198,18 @@ def test_sx_adaptor_settings_backend_name_unlabeled_type():
209
198
{
210
199
'type' : 'xaod' ,
211
200
'endpoint' : 'http://my-left-foot.com:5000' ,
212
- 'email' : 'thegoodplace@example.com' ,
213
- 'password' : 'forkingshirtballs' ,
201
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
214
202
},
215
203
{
216
204
'endpoint' : 'http://my-left-foot.com:5001' ,
217
- 'email' : 'thegoodplace1@example.com' ,
218
- 'password' : 'forkingshirtballs1' ,
205
+ 'token' : 'forkingshirtballs.thegoodplace.bortles1'
219
206
}
220
207
]
221
208
x = ServiceXConfigAdaptor (c )
222
- endpoint , email , password = x .get_servicex_adaptor_config ()
209
+ endpoint , token = x .get_servicex_adaptor_config ()
223
210
224
211
assert endpoint == 'http://my-left-foot.com:5001'
225
- assert email == 'thegoodplace1@example.com'
226
- assert password == 'forkingshirtballs1'
212
+ assert token == 'forkingshirtballs.thegoodplace.bortles1'
227
213
228
214
229
215
def test_sx_adaptor_settings_wrong_type ():
@@ -234,8 +220,7 @@ def test_sx_adaptor_settings_wrong_type():
234
220
{
235
221
'type' : 'my-type' ,
236
222
'endpoint' : 'http://my-left-foot.com:5000' ,
237
- 'email' : 'thegoodplace@example.com' ,
238
- 'password' : 'forkingshirtballs' ,
223
+ 'token' : 'forkingshirtballs.thegoodplace.bortles'
239
224
}
240
225
]
241
226
@@ -255,23 +240,20 @@ def test_sx_adaptor_settings_env():
255
240
{
256
241
'type' : '${SXTYPE}' ,
257
242
'endpoint' : '${ENDPOINT}:5000' ,
258
- 'email' : '${SXUSER}' ,
259
- 'password' : '${SXPASS}' ,
243
+ 'token' : '${SXTOKEN}' ,
260
244
}
261
245
]
262
246
263
247
from os import environ
264
248
environ ['ENDPOINT' ] = 'http://tachi.com'
265
- environ ['SXUSER' ] = 'Holden'
266
- environ ['SXPASS' ] = 'protomolecule'
267
249
environ ['SXTYPE' ] = 'mcrn'
250
+ environ ['SXTOKEN' ] = 'protomolecule'
268
251
269
252
x = ServiceXConfigAdaptor (c )
270
- endpoint , email , password = x .get_servicex_adaptor_config ('mcrn' )
253
+ endpoint , token = x .get_servicex_adaptor_config ('mcrn' )
271
254
272
255
assert endpoint == 'http://tachi.com:5000'
273
- assert email == 'Holden'
274
- assert password == 'protomolecule'
256
+ assert token == 'protomolecule'
275
257
276
258
277
259
def test_default_config_endpoint ():
@@ -280,10 +262,9 @@ def test_default_config_endpoint():
280
262
c ._add_default_source ()
281
263
x = ServiceXConfigAdaptor (c )
282
264
283
- end_point , email , password = x .get_servicex_adaptor_config ()
265
+ end_point , token = x .get_servicex_adaptor_config ()
284
266
assert end_point == 'http://localhost:5000'
285
- assert email is None
286
- assert password is None
267
+ assert token is None
287
268
288
269
289
270
def test_sx_adaptor_nothing ():
0 commit comments