Changeset View
Changeset View
Standalone View
Standalone View
swh/search/tests/test_serializers.py
- This file was added.
# Copyright (C) 2020 The Software Heritage developers | |||||
# See the AUTHORS file at the top-level directory of this distribution | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from swh.model.model import Origin | |||||
from swh.search.api.serializers import _encode_model_object, _decode_model_object | |||||
def test_serialization_back_and_forth(): | |||||
"""Testing serialization on origin back and forth should be fine | |||||
""" | |||||
origin = Origin(url="foobar") | |||||
assert _decode_model_object(_encode_model_object(origin)) == origin |