@@ -40,19 +40,19 @@ def create_todo(self, title="Test todo", description="Test todo description"):
40
40
41
41
def test_create_todo (self ):
42
42
response = self .client .post (
43
- "/api/v1/todo " ,
43
+ "/api/v1/todos " ,
44
44
json = {"title" : "Test Todo" , "description" : "Test todo description" })
45
45
self .assertEqual (response .status_code , 201 )
46
46
47
47
def test_get_todos (self ):
48
- response = self .client .get ("/api/v1/todo " )
48
+ response = self .client .get ("/api/v1/todos " )
49
49
self .assertEqual (response .status_code , 200 )
50
50
51
51
def test_update_todo (self ):
52
52
todo = self .create_todo ()
53
53
54
54
response = self .client .put (
55
- f"/api/v1/todo /{ todo .id } " ,
55
+ f"/api/v1/todos /{ todo .id } " ,
56
56
data = json .dumps ({"title" : "Updated test todo" ,
57
57
"description" : "Updated test todo description" }),
58
58
content_type = "application/json" ,
@@ -61,18 +61,18 @@ def test_update_todo(self):
61
61
62
62
def test_delete_todo (self ):
63
63
todo = self .create_todo ()
64
- response = self .client .delete (f"/api/v1/todo /{ todo .id } " )
64
+ response = self .client .delete (f"/api/v1/todos /{ todo .id } " )
65
65
self .assertEqual (response .status_code , 204 )
66
66
67
67
def test_get_todo (self ):
68
68
todo = self .create_todo ()
69
69
70
- response = self .client .get (f"/api/v1/todo /{ todo .id } " )
70
+ response = self .client .get (f"/api/v1/todos /{ todo .id } " )
71
71
self .assertEqual (response .status_code , 200 )
72
72
73
73
def test_invalid_input (self ):
74
74
response = self .client .post (
75
- "/api/v1/todo " ,
75
+ "/api/v1/todos " ,
76
76
json = {
77
77
"description" : "Test todo description" ,
78
78
"done" : False ,
@@ -82,7 +82,7 @@ def test_invalid_input(self):
82
82
83
83
def test_update_nonexistent_todo (self ):
84
84
response = self .client .put (
85
- "/api/v1/todo /99999999" ,
85
+ "/api/v1/todos /99999999" ,
86
86
json = {
87
87
"title" : "Updated test todo" ,
88
88
"description" : "Updated test todo description" ,
@@ -93,7 +93,7 @@ def test_update_nonexistent_todo(self):
93
93
94
94
def test_delete_nonexistent_todo (self ):
95
95
response = self .client .delete (
96
- "/api/v1/todo /99999999" ,
96
+ "/api/v1/todos /99999999" ,
97
97
json = {
98
98
"title" : "Delete test todo" ,
99
99
"description" : "Delete test todo description" ,
0 commit comments