Skip to content

Commit 40ad62b

Browse files
arhowe00ebrahimebrahim
authored andcommitted
Add delete case to test_load_all_users (#203)
- Add test to make sure that load_all_users responds to changes in the users.json file
1 parent d823a17 commit 40ad62b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_database.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def test_load_all_users(example_database: Database):
160160
assert len(loaded_users) == 1 + previous_number_of_users_in_database
161161
assert any(dataclasses_are_equal(u, user) for u in loaded_users)
162162

163+
example_database.delete_user(user.id, on_conflict=OnConflictOpts.ERROR)
164+
165+
loaded_users = example_database.load_all_users()
166+
assert len(loaded_users) == previous_number_of_users_in_database
167+
assert not any(dataclasses_are_equal(u, user) for u in loaded_users)
168+
163169
def test_load_session_from_file(example_session : Session, example_database : Database):
164170

165171
# Test that Session loaded via Session.from_file is correct

0 commit comments

Comments
 (0)