diff --git a/integrationtests/realworld_example/crawl.sh b/integrationtests/realworld_example/crawl.sh deleted file mode 100755 index 55a2a331fe517a539e2dd937ac35605c72b496c9..0000000000000000000000000000000000000000 --- a/integrationtests/realworld_example/crawl.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -python -m caosadvancedtools.loadFiles /opt/caosdb/mnt/extroot/data -python load_and_insert_json_models.py -python test_dataset_crawler.py diff --git a/integrationtests/realworld_example/load_and_insert_json_models.py b/integrationtests/realworld_example/load_and_insert_json_models.py deleted file mode 100644 index 682fd9c77531e63ed18dd13417399ad0d18a8de2..0000000000000000000000000000000000000000 --- a/integrationtests/realworld_example/load_and_insert_json_models.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 -# encoding: utf-8 -# -# This file is a part of the CaosDB Project. -# -# Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> -# Copyright (C) 2022 Henrik tom Wörden <h.tomwoerden@indiscale.com> -# Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -import sys - -from caosadvancedtools.models.parser import parse_model_from_json_schema, parse_model_from_yaml - - -def main(): - # First load dataspace data model - dataspace_definitions = parse_model_from_json_schema( - "schema/dataspace.schema.json") - dataspace_definitions.sync_data_model(noquestion=True) - - # Then general dataset definitions - dataset_definitions = parse_model_from_json_schema( - "schema/dataset.schema.json") - dataset_definitions.sync_data_model(noquestion=True) - - # Finally, add inheritances as defined in yaml - dataset_inherits = parse_model_from_yaml( - "schema/dataset-inheritance.yml") - dataset_inherits.sync_data_model(noquestion=True) - - -if __name__ == "__main__": - - sys.exit(main()) diff --git a/integrationtests/realworld_example/test_dataset_crawler.py b/integrationtests/realworld_example/test_dataset_crawler.py index 8713f490399471dc324c542f5d0e96bfe161b60a..d5a7d972696d7b9d4a5f60a32e30a961b9075303 100644 --- a/integrationtests/realworld_example/test_dataset_crawler.py +++ b/integrationtests/realworld_example/test_dataset_crawler.py @@ -72,8 +72,17 @@ def usemodel(): dataset_inherits.sync_data_model(noquestion=True) +@pytest.fixture +def clear_database(): + # TODO(fspreck): Remove once the corresponding avdvancedtools function can + # be used. + ents = db.execute_query("FIND ENTITY WITH ID>99") + if ents: + ents.delete() + + def test_dataset( - # clear_database, + clear_database, usemodel): # json_file_path = rfp("test_directories", "single_file_test_data", "testjson.json")