Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_postgresql_converters.py
- This file was moved from swh/storage/tests/test_converters.py.
# Copyright (C) 2015 The Software Heritage developers | # Copyright (C) 2015 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from swh.model.model import ( | from swh.model.model import ( | ||||
ObjectType, | ObjectType, | ||||
Person, | Person, | ||||
Release, | Release, | ||||
Revision, | Revision, | ||||
RevisionType, | RevisionType, | ||||
Timestamp, | Timestamp, | ||||
TimestampWithTimezone, | TimestampWithTimezone, | ||||
) | ) | ||||
from swh.storage import converters | from swh.storage.postgresql import converters | ||||
def test_date_to_db(): | def test_date_to_db(): | ||||
date_to_db = converters.date_to_db | date_to_db = converters.date_to_db | ||||
assert date_to_db(None) == {"timestamp": None, "offset": 0, "neg_utc_offset": None} | assert date_to_db(None) == {"timestamp": None, "offset": 0, "neg_utc_offset": None} | ||||
assert date_to_db( | assert date_to_db( | ||||
TimestampWithTimezone( | TimestampWithTimezone( | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |