Skip to content

Commit

Permalink
Update tests to reflect behavior changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Oct 25, 2024
1 parent 1987049 commit 19a1fcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_user_model(self):
default_user = User(**user_kwargs)
self.assertIsInstance(default_user.tokens[0], TokenConfig)
with self.assertRaises(ValidationError):
User(username="test")
User()

with self.assertRaises(ValidationError):
User(username="test", password_hash="test",
Expand Down
7 changes: 4 additions & 3 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

from neon_users_service.databases import UserDatabase
from neon_users_service.databases.sqlite import SQLiteUserDatabase
from neon_users_service.exceptions import ConfigurationError, AuthenticationError, UserNotFoundError
from neon_users_service.exceptions import ConfigurationError, AuthenticationError, UserNotFoundError, \
UserNotMatchedError
from neon_users_service.models import User
from neon_users_service.service import NeonUsersService

Expand Down Expand Up @@ -131,13 +132,13 @@ def test_delete_user(self):
with self.assertRaises(UserNotFoundError):
service.delete_user(invalid_user)

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

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

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

service.shutdown()

0 comments on commit 19a1fcf

Please sign in to comment.