Skip to content

Commit 4ebe3fb

Browse files
Readded server cert checks to test_api_v1_user.py but changed context to expect server certificates to be allowed
1 parent 999447b commit 4ebe3fb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/test_api_v1_user.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,7 @@ class APIUnitTestUser(unit_test_framework.APIUnitTest):
202202
}
203203
},
204204
{
205-
"name": "Check inability to add server certificate as a user certificate",
206-
"status": 400,
207-
"return": 5041,
205+
"name": "Check ability to add server certificate as a user certificate",
208206
"server_cert": True,
209207
"payload": {
210208
"username": "new_user",
@@ -289,15 +287,22 @@ def post_post(self):
289287
post_counter = 0
290288
put_counter = 0
291289

292-
# Loop through all tests and auto-add the refid to payloads that have the user_cert set
290+
# Loop through all tests and auto-add the refid to payloads that have the user_cert or server_cert set
293291
for test in self.post_tests:
294292
if "payload" in test.keys() and "user_cert" in test.keys():
295293
self.post_tests[post_counter]["payload"]["cert"] = [self.post_responses[1]["data"]["refid"]]
296294

295+
if "payload" in test.keys() and "server_cert" in test.keys():
296+
self.post_tests[post_counter]["payload"]["cert"] = [self.post_responses[2]["data"]["refid"]]
297+
post_counter = post_counter + 1
297298

298299
# Do the same for PUT tests
299300
for test in self.put_tests:
300301
if "payload" in test.keys() and "user_cert" in test.keys():
301302
self.put_tests[put_counter]["payload"]["cert"] = [self.post_responses[1]["data"]["refid"]]
302303

304+
if "payload" in test.keys() and "server_cert" in test.keys():
305+
self.put_tests[put_counter]["payload"]["cert"] = [self.post_responses[2]["data"]["refid"]]
306+
put_counter = put_counter + 1
307+
303308
APIUnitTestUser()

0 commit comments

Comments
 (0)