File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,17 @@ def test_box_basics():
77
77
78
78
# remove
79
79
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
81
86
82
87
# check they're gone
83
88
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
88
91
89
92
ob .close ()
90
93
@@ -166,14 +169,13 @@ def test_datetime():
166
169
assert pytest .approx (read .date .timestamp ()) == object .date .timestamp ()
167
170
168
171
# remove
169
- box .remove (object )
172
+ success = box .remove (object )
173
+ assert success == True
170
174
171
175
# check they're gone
172
176
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
177
179
178
180
ob .close ()
179
181
You can’t perform that action at this time.
0 commit comments