Skip to content

Commit

Permalink
Add unit test coverage for delete_user
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Oct 25, 2024
1 parent 499c635 commit ae37559
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,22 @@ def test_update_user(self):
service.shutdown()

def test_delete_user(self):
pass
service = NeonUsersService(self.test_config)
user_1 = service.create_user(User(username="user",
password_hash="test"))
invalid_user = User(username="user", password_hash="test")
incomplete_user = service.read_unauthenticated_user(user_1.user_id)

with self.assertRaises(UserNotFoundError):
service.delete_user(invalid_user)

with self.assertRaises(UserNotFoundError):
service.delete_user(incomplete_user)

deleted = service.delete_user(user_1)
self.assertEqual(deleted, user_1)

with self.assertRaises(UserNotFoundError):
service.read_unauthenticated_user(user_1.user_id)

service.shutdown()

0 comments on commit ae37559

Please sign in to comment.