Skip to content
Snippets Groups Projects
Commit a3eb23a6 authored by florian's avatar florian
Browse files

MAINT: Clean-up of real-world example

parent cfc16379
Branches
Tags
2 merge requests!53Release 0.1,!14F integration test simple
#!/bin/bash
python -m caosadvancedtools.loadFiles /opt/caosdb/mnt/extroot/data
python load_and_insert_json_models.py
python test_dataset_crawler.py
#!/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())
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment