You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
544 B
22 lines
544 B
from atheneum.model import UserToken
|
|
from atheneum.service.transformation_service import (
|
|
serialize_model,
|
|
deserialize_model
|
|
)
|
|
|
|
|
|
def test_serialize_model():
|
|
user_token = UserToken()
|
|
user_token.token = 'test'
|
|
result = serialize_model(user_token)
|
|
assert result is not None
|
|
assert result['token'] == 'test'
|
|
|
|
|
|
def test_deserialize_model():
|
|
user_token_json = {
|
|
'token': 'test'
|
|
}
|
|
result = deserialize_model('UserToken', user_token_json)
|
|
assert result is not None
|
|
assert result.token == 'test'
|