File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 13
13
HEADERS = {"Content-Type" : "application/json" }
14
14
15
15
UPDATED_ITEM_GROUP = {
16
+ "id" : 1 ,
16
17
"Name" : "Updated test name" ,
17
18
"Description" : "Updated test description"
18
19
}
@@ -62,9 +63,11 @@ def test_put():
62
63
generated_id = test_helper .get_integer_from_json_string (json )
63
64
assert generated_id != 0
64
65
# modify the added item group
66
+ UPDATED_ITEM_GROUP ["id" ] = generated_id
65
67
put_response = requests .put (
66
68
BASE_URL + f"/{ generated_id } " , headers = HEADERS , json = UPDATED_ITEM_GROUP )
67
69
assert put_response .status_code == 200
70
+ requests .delete (BASE_URL + f"/{ generated_id } " )
68
71
69
72
70
73
def test_put_Item_group_that_does_not_exist ():
@@ -81,9 +84,8 @@ def test_delete():
81
84
82
85
delete_response = requests .delete (
83
86
BASE_URL + f"/{ generated_id } " )
84
-
87
+
85
88
assert delete_response .status_code == 200
86
89
87
90
get_response = requests .get (BASE_URL + str (generated_id ))
88
91
assert get_response .status_code == 404
89
-
Original file line number Diff line number Diff line change 13
13
HEADERS = {"Content-Type" : "application/json" }
14
14
15
15
UPDATED_ITEM_LINE = {
16
+ "id" : 0 ,
16
17
"Name" : "Updated test name" ,
17
18
"Description" : "Updated test description"
18
19
}
@@ -61,6 +62,7 @@ def test_put():
61
62
# look here for an integer (digit)
62
63
generated_id = test_helper .get_integer_from_json_string (json )
63
64
assert generated_id != 0
65
+ UPDATED_ITEM_LINE ["id" ] = generated_id
64
66
# modify the added item line
65
67
put_response = requests .put (
66
68
BASE_URL + f"/{ generated_id } " , headers = HEADERS , json = UPDATED_ITEM_LINE )
@@ -81,9 +83,8 @@ def test_delete():
81
83
82
84
delete_response = requests .delete (
83
85
BASE_URL + f"/{ generated_id } " )
84
-
86
+
85
87
assert delete_response .status_code == 200
86
88
87
89
get_response = requests .get (BASE_URL + str (generated_id ))
88
90
assert get_response .status_code == 404
89
-
You can’t perform that action at this time.
0 commit comments