@@ -12,52 +12,52 @@ def _setup_repository(self, test_client: MongoDatabaseClient):
1212 self .repository = TodoRepository (client = test_client )
1313
1414 def test_create (self ):
15- todo_item = TodoItem (id = "1234" , title = "todo 1" )
15+ todo_item = TodoItem (id = "1234" , title = "todos 1" )
1616 self .repository .create (todo_item )
1717 assert len (self .repository .get_all ()) == 1
1818
1919 def test_create_already_exists (self ):
20- todo_item_1 = TodoItem (id = "1234" , title = "todo 1" )
20+ todo_item_1 = TodoItem (id = "1234" , title = "todos 1" )
2121 self .repository .create (todo_item_1 )
2222 with pytest .raises (ValidationException ):
23- todo_item_2 = TodoItem (id = "1234" , title = "todo 1" )
23+ todo_item_2 = TodoItem (id = "1234" , title = "todos 1" )
2424 self .repository .create (todo_item_2 )
2525
2626 def test_find_item_that_exist (self ):
2727 documents = [
28- {"_id" : "81549300" , "title" : "todo 1" },
29- {"_id" : "1a2b" , "title" : "todo 2" },
30- {"_id" : "987321" , "title" : "todo 3" },
28+ {"_id" : "81549300" , "title" : "todos 1" },
29+ {"_id" : "1a2b" , "title" : "todos 2" },
30+ {"_id" : "987321" , "title" : "todos 3" },
3131 {
3232 "_id" : "987456" ,
33- "title" : "todo 4" ,
33+ "title" : "todos 4" ,
3434 },
3535 ]
3636 self .repository .client .insert_many (documents )
37- todo_item = self .repository .find_one ({"title" : "todo 2" })
37+ todo_item = self .repository .find_one ({"title" : "todos 2" })
3838 assert todo_item .id == "1a2b"
3939
4040 def test_find_item_that_does_not_exist (self ):
4141 documents = [
42- {"_id" : "81549300" , "title" : "todo 1" },
43- {"_id" : "1a2b" , "title" : "todo 2" },
44- {"_id" : "987321" , "title" : "todo 3" },
42+ {"_id" : "81549300" , "title" : "todos 1" },
43+ {"_id" : "1a2b" , "title" : "todos 2" },
44+ {"_id" : "987321" , "title" : "todos 3" },
4545 {
4646 "_id" : "987456" ,
47- "title" : "todo 4" ,
47+ "title" : "todos 4" ,
4848 },
4949 ]
5050 self .repository .client .insert_many (documents )
5151 assert self .repository .find_one ({"_id" : "invalid" }) is None
5252
5353 def test_get_item_that_does_exist (self ):
5454 documents = [
55- {"_id" : "81549300" , "title" : "todo 1" },
56- {"_id" : "1a2b" , "title" : "todo 2" },
57- {"_id" : "987321" , "title" : "todo 3" },
55+ {"_id" : "81549300" , "title" : "todos 1" },
56+ {"_id" : "1a2b" , "title" : "todos 2" },
57+ {"_id" : "987321" , "title" : "todos 3" },
5858 {
5959 "_id" : "987456" ,
60- "title" : "todo 4" ,
60+ "title" : "todos 4" ,
6161 },
6262 ]
6363 self .repository .client .insert_many (documents )
@@ -66,20 +66,20 @@ def test_get_item_that_does_exist(self):
6666
6767 def test_get_item_that_does_not_exist (self ):
6868 documents = [
69- {"_id" : "81549300" , "title" : "todo 1" },
70- {"_id" : "1a2b" , "title" : "todo 2" },
71- {"_id" : "987321" , "title" : "todo 3" },
69+ {"_id" : "81549300" , "title" : "todos 1" },
70+ {"_id" : "1a2b" , "title" : "todos 2" },
71+ {"_id" : "987321" , "title" : "todos 3" },
7272 {
7373 "_id" : "987456" ,
74- "title" : "todo 4" ,
74+ "title" : "todos 4" ,
7575 },
7676 ]
7777 self .repository .client .insert_many (documents )
7878 with pytest .raises (NotFoundException ):
7979 self .repository .get ("invalid" )
8080
8181 def test_update_item (self ):
82- todo_item = TodoItem (id = "81549300" , title = "todo 1" )
82+ todo_item = TodoItem (id = "81549300" , title = "todos 1" )
8383 self .repository .create (todo_item )
8484 todo_item_to_update = TodoItem (id = "81549300" , title = "Updated title" )
8585 self .repository .update (todo_item = todo_item_to_update )
@@ -91,15 +91,15 @@ def test_update_item_that_does_not_exist(self):
9191 self .repository .update (todo_item_to_update )
9292
9393 def test_delete (self ):
94- documents = [{"_id" : "81549300" , "title" : "todo 1" }, {"_id" : "1a2b" , "title" : "todo 2" }]
94+ documents = [{"_id" : "81549300" , "title" : "todos 1" }, {"_id" : "1a2b" , "title" : "todos 2" }]
9595 self .repository .client .insert_many (documents )
9696 assert len (self .repository .get_all ()) == 2
9797 self .repository .delete ("81549300" )
9898 assert len (self .repository .get_all ()) == 1
9999 assert self .repository .get_all () == [self .repository .get ("1a2b" )]
100100
101101 def test_delete_all (self ):
102- documents = [{"_id" : "81549300" , "title" : "todo 1" }, {"_id" : "1a2b" , "title" : "todo 2" }]
102+ documents = [{"_id" : "81549300" , "title" : "todos 1" }, {"_id" : "1a2b" , "title" : "todos 2" }]
103103 self .repository .client .insert_many (documents )
104104 assert len (self .repository .get_all ()) == 2
105105 self .repository .delete_all ()
0 commit comments