Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/conftest.py
Show All 12 Lines | |||||
from os import path, environ | from os import path, environ | ||||
from hypothesis import settings | from hypothesis import settings | ||||
from typing import Dict | from typing import Dict | ||||
import swh.storage | import swh.storage | ||||
from swh.core.utils import numfile_sortkey as sortkey | from swh.core.utils import numfile_sortkey as sortkey | ||||
from swh.model.tests.generate_testdata import gen_contents, gen_origins | from swh.model.tests.generate_testdata import gen_contents, gen_origins | ||||
from swh.model.model import ( | from swh.model.model import ( | ||||
Content, | Content, | ||||
Directory, | Directory, | ||||
Origin, | Origin, | ||||
OriginVisit, | OriginVisit, | ||||
Release, | Release, | ||||
Revision, | Revision, | ||||
SkippedContent, | SkippedContent, | ||||
Snapshot, | Snapshot, | ||||
) | ) | ||||
OBJECT_FACTORY = { | OBJECT_FACTORY = { | ||||
"content": Content.from_dict, | "content": Content.from_dict, | ||||
"directory": Directory.from_dict, | "directory": Directory.from_dict, | ||||
"origin": Origin.from_dict, | "origin": Origin.from_dict, | ||||
"origin_visit": OriginVisit.from_dict, | "origin_visit": OriginVisit.from_dict, | ||||
"release": Release.from_dict, | "release": Release.from_dict, | ||||
"revision": Revision.from_dict, | "revision": Revision.from_dict, | ||||
"skipped_content": SkippedContent.from_dict, | "skipped_content": SkippedContent.from_dict, | ||||
"snapshot": Snapshot.from_dict, | "snapshot": Snapshot.from_dict, | ||||
} | } | ||||
SQL_DIR = path.join(path.dirname(swh.storage.__file__), "sql") | SQL_DIR = path.join(path.dirname(swh.storage.__file__), "sql") | ||||
environ["LC_ALL"] = "C.UTF-8" | environ["LC_ALL"] = "C.UTF-8" | ||||
DUMP_FILES = path.join(SQL_DIR, "*.sql") | DUMP_FILES = path.join(SQL_DIR, "*.sql") | ||||
# define tests profile. Full documentation is at: | # define tests profile. Full documentation is at: | ||||
# https://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles | # https://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |