File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,14 +77,17 @@ def test_box_basics():
7777
7878 # remove
7979 box .remove (object )
80- box .remove (1 )
80+
81+ # remove should return success
82+ success = box .remove (1 )
83+ assert success == True
84+ success = box .remove (1 )
85+ assert success == False
8186
8287 # check they're gone
8388 assert box .count () == 0
84- with pytest .raises (objectbox .NotFoundException ):
85- box .get (object .id )
86- with pytest .raises (objectbox .NotFoundException ):
87- box .get (1 )
89+ assert box .get (object .id ) == None
90+ assert box .get (1 ) == None
8891
8992 ob .close ()
9093
@@ -166,14 +169,13 @@ def test_datetime():
166169 assert pytest .approx (read .date .timestamp ()) == object .date .timestamp ()
167170
168171 # remove
169- box .remove (object )
172+ success = box .remove (object )
173+ assert success == True
170174
171175 # check they're gone
172176 assert box .count () == 0
173- with pytest .raises (objectbox .NotFoundException ):
174- box .get (object .id )
175- with pytest .raises (objectbox .NotFoundException ):
176- box .get (1 )
177+ assert box .get (object .id ) == None
178+ assert box .get (1 ) == None
177179
178180 ob .close ()
179181
You can’t perform that action at this time.
0 commit comments