mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
2c84ee1541
Also take a pass on the docstrings.
14 lines
444 B
Python
14 lines
444 B
Python
from datetime import datetime as dt
|
|
from moulinette.utils.serialize import JSONExtendedEncoder
|
|
|
|
|
|
def test_json_extended_encoder(caplog):
|
|
encoder = JSONExtendedEncoder()
|
|
|
|
assert encoder.default(set([1, 2, 3])) == [1, 2, 3]
|
|
|
|
assert encoder.default(dt(1917, 3, 8)) == '1917-03-08T00:00:00+00:00'
|
|
|
|
assert encoder.default(None) == 'None'
|
|
for message in caplog.messages:
|
|
assert 'cannot properly encode in JSON' in message
|