-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_06_patch_contact.py
More file actions
43 lines (29 loc) · 1.21 KB
/
Copy pathtest_06_patch_contact.py
File metadata and controls
43 lines (29 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from base import Base
class TestPatchContact(Base):
def test_patch_contact(self):
# Get Bearer token
if not self.token:
self.create_user()
self.get_token()
assert self.token
self.create_contact(self.creds_file['contacts'][0])
# Get Contact id
response_code, response = self.get_contacts()
# Verify that contact id is receieved
assert response_code == 200
contact_id = response[0]['_id']
# Update any single contact entity
response_code, response = self.update_contact("PATCH", contact_id)
# Verify that API call was successful
assert response_code == 200
# Verify that the correct contact was updated
assert response["_id"] == contact_id
# Call to get contact
response_code, response = self.get_contact(contact_id)
# Verify that API call was successful
assert response_code == 200
# Verify that the correct contact details are receieved
assert response["_id"] == contact_id
# Verify that the value is updated
for key in self.updated_values:
assert response[key] == self.updated_values[key]