Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/data.py
# Copyright (C) 2022 The Software Heritage developers | # Copyright (C) 2022 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 | ||||
# This module will be removed once the test data | |||||
# generation in SWH-wb moved to a shared location | |||||
# or to a new test data project | |||||
from swh.model.tests import swh_model_data | from swh.model.tests import swh_model_data | ||||
def populate_dummy_data(storage): | def populate_dummy_data(storage): | ||||
for object_type, objects in swh_model_data.TEST_OBJECTS.items(): | for object_type, objects in swh_model_data.TEST_OBJECTS.items(): | ||||
method = getattr(storage, object_type + "_add") | method = getattr(storage, object_type + "_add") | ||||
method(objects) | method(objects) | ||||
def get_origins(): | def get_origins(): | ||||
return swh_model_data.ORIGINS | return swh_model_data.ORIGINS | ||||
def get_snapshots(): | def get_snapshots(): | ||||
return swh_model_data.SNAPSHOTS | return swh_model_data.SNAPSHOTS |