@@ -154,7 +154,7 @@ def add_account_via_patch(sut: SystemUnderTest, session, user, role, password,
154
154
if role :
155
155
payload ['RoleId' ] = role
156
156
headers = utils .get_etag_header (sut , session , uri )
157
- response = session .patch (sut . rhost + uri , json = payload , headers = headers )
157
+ response = sut .patch (uri , json = payload , headers = headers , session = session )
158
158
sut .add_response (uri , response , resource_type = ResourceType .MANAGER_ACCOUNT ,
159
159
request_type = request_type )
160
160
success = response .status_code == requests .codes .OK
@@ -166,8 +166,7 @@ def add_account_via_patch(sut: SystemUnderTest, session, user, role, password,
166
166
if 'Enabled' in data and data ['Enabled' ] is False :
167
167
headers = utils .get_etag_header (sut , session , uri )
168
168
payload = {'Enabled' : True }
169
- session .patch (sut .rhost + uri , json = payload ,
170
- headers = headers )
169
+ sut .patch (uri , json = payload , headers = headers , session = session )
171
170
sut .add_response (uri , response ,
172
171
resource_type = ResourceType .MANAGER_ACCOUNT ,
173
172
request_type = request_type )
@@ -199,7 +198,7 @@ def add_account(sut: SystemUnderTest, session,
199
198
payload = {'UserName' : user , 'Password' : password }
200
199
if role :
201
200
payload ['RoleId' ] = role
202
- response = session .post (sut .rhost + sut . accounts_uri , json = payload )
201
+ response = sut .post (sut .accounts_uri , json = payload , session = session )
203
202
sut .add_response (sut .accounts_uri , response , request_type = request_type )
204
203
205
204
new_acct_uri = None
@@ -229,8 +228,8 @@ def patch_account(sut: SystemUnderTest, session, acct_uri,
229
228
pwd = new_password (sut )
230
229
payload = {'Password' : pwd , 'BogusProp' : 'foo' }
231
230
headers = utils .get_etag_header (sut , session , acct_uri )
232
- response = session .patch (sut . rhost + acct_uri , json = payload ,
233
- headers = headers )
231
+ response = sut .patch (acct_uri , json = payload , headers = headers ,
232
+ session = session )
234
233
if response .ok :
235
234
new_pwd = pwd
236
235
sut .add_response (acct_uri , response ,
@@ -239,8 +238,8 @@ def patch_account(sut: SystemUnderTest, session, acct_uri,
239
238
# patch a single property that can never be updated
240
239
payload = {'BogusProp' : 'foo' }
241
240
headers = utils .get_etag_header (sut , session , acct_uri )
242
- response = session .patch (sut . rhost + acct_uri , json = payload ,
243
- headers = headers )
241
+ response = sut .patch (acct_uri , json = payload , headers = headers ,
242
+ session = session )
244
243
sut .add_response (acct_uri , response ,
245
244
resource_type = ResourceType .MANAGER_ACCOUNT ,
246
245
request_type = RequestType .PATCH_BAD_PROP )
@@ -249,8 +248,8 @@ def patch_account(sut: SystemUnderTest, session, acct_uri,
249
248
else acct_uri + '/' )
250
249
payload = {'@odata.id' : odata_id }
251
250
headers = utils .get_etag_header (sut , session , acct_uri )
252
- response = session .patch (sut . rhost + acct_uri , json = payload ,
253
- headers = headers )
251
+ response = sut .patch (acct_uri , json = payload , headers = headers ,
252
+ session = session )
254
253
sut .add_response (acct_uri , response ,
255
254
resource_type = ResourceType .MANAGER_ACCOUNT ,
256
255
request_type = RequestType .PATCH_ODATA_PROPS )
@@ -260,8 +259,8 @@ def patch_account(sut: SystemUnderTest, session, acct_uri,
260
259
pwd = new_password (sut )
261
260
payload = {'Password' : pwd }
262
261
headers = utils .get_etag_header (sut , session , acct_uri )
263
- response = session .patch (sut . rhost + acct_uri , json = payload ,
264
- headers = headers )
262
+ response = sut .patch (acct_uri , json = payload , headers = headers ,
263
+ session = session )
265
264
if response .ok :
266
265
new_pwd = pwd
267
266
sut .add_response (acct_uri , response ,
@@ -273,8 +272,8 @@ def patch_account(sut: SystemUnderTest, session, acct_uri,
273
272
payload = {'Password' : pwd }
274
273
new_headers = utils .get_etag_header (sut , session , acct_uri )
275
274
bad_headers = {'If-Match' : new_headers ['If-Match' ] + 'foobar' }
276
- r = session .patch (sut . rhost + acct_uri , json = payload ,
277
- headers = bad_headers )
275
+ r = sut .patch (acct_uri , json = payload , headers = bad_headers ,
276
+ session = session )
278
277
if r .ok :
279
278
new_pwd = pwd
280
279
sut .add_response (acct_uri , r ,
@@ -293,8 +292,8 @@ def delete_account_via_patch(sut: SystemUnderTest, session, user, acct_uri,
293
292
if data .get ('Enabled' , False ):
294
293
payload ['Enabled' ] = False
295
294
headers = utils .get_etag_header (sut , session , acct_uri )
296
- response = session .patch (sut . rhost + acct_uri , json = payload ,
297
- headers = headers )
295
+ response = sut .patch (acct_uri , json = payload , headers = headers ,
296
+ session = session )
298
297
sut .add_response (acct_uri , response ,
299
298
resource_type = ResourceType .MANAGER_ACCOUNT ,
300
299
request_type = request_type )
@@ -318,7 +317,7 @@ def delete_account(sut: SystemUnderTest, session, user, acct_uri,
318
317
delete_account_via_patch (sut , session , user , acct_uri ,
319
318
request_type = request_type )
320
319
return
321
- response = session .delete (sut . rhost + acct_uri )
320
+ response = sut .delete (acct_uri , session = session )
322
321
sut .add_response (acct_uri , response ,
323
322
resource_type = ResourceType .MANAGER_ACCOUNT ,
324
323
request_type = request_type )
@@ -340,8 +339,8 @@ def password_change_required(sut: SystemUnderTest, session, user, password,
340
339
if not account_enabled :
341
340
payload ['Enabled' ] = True
342
341
headers = {'If-Match' : etag } if etag else {}
343
- response = session .patch (sut . rhost + uri , json = payload ,
344
- headers = headers )
342
+ response = sut .patch (uri , json = payload , headers = headers ,
343
+ session = session )
345
344
sut .add_response (uri , response ,
346
345
resource_type = ResourceType .MANAGER_ACCOUNT )
347
346
if not response .ok :
0 commit comments