diff --git a/tests/test_service.py b/tests/test_service.py index 86b5234..84dc168 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -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()