Skip to content
Snippets Groups Projects
Commit 7d895edf authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: created pytest file

parent d25dcd85
No related branches found
No related tags found
1 merge request!11F integration test baltasar
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
[Connection]
ssl_insecure=false
url=https://localhost:10443/
password=caosdb
username=admin
password_method=plain
cacert=/home/salexan/Projekte/2022/220309_DPGErlangenHackathon/live/live-profile/custom/other/cert/caosdb.cert.pem
timeout=10000
debug=0
[Container]
debug=0
......@@ -21,9 +21,8 @@ default:
# extroot: From where files are copied/symlinked. This is a
# list of `NAME: PATH` pairs or a single path.
extroot:
"": "paths/extroot"
#
# "base": "/path/to/base/dir"
# "": "paths/extroot"
"base": "../use_case_cardiac_simulation/extroot"
# "other": "/path/to/other"
#
# dropoffbox: (Soon to be deprecated.) Files can be written here, but note that you may need to
......
#!/usr/bin/env python3
# encoding: utf-8
#
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 Indiscale GmbH <info@indiscale.com>
# 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com>
# 2021 Alexander Schlemmer
#
# 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/>.
#
# ** end header
#
"""
module description
"""
from caosdb import EmptyUniqueQueryError
import argparse
import sys
from argparse import RawTextHelpFormatter
from newcrawler import Crawler
import caosdb as db
from newcrawler.identifiable_adapters import CaosDBIdentifiableAdapter
import pytest
from caosadvancedtools.models.parser import parse_model_from_yaml
from caosadvancedtools.models import parser as parser
import yaml
from caosadvancedtools.loadFiles import loadpath
from subprocess import run
from caosadvancedtools.testutils import clear_database, set_test_key
set_test_key("10b128cf8a1372f30aa3697466bb55e76974e0c16a599bb44ace88f19c8f61e2")
import os
def rfp(*pathcomponents):
"""
Return full path.
Shorthand convenience function.
"""
return os.path.join(os.path.dirname(__file__), *pathcomponents)
def test_complete_crawler(clear_database):
# Setup the data model:
model = parser.parse_model_from_yaml("use_case_cardiac_simulation/model.yml")
model.sync_data_model(noquestion=True, verbose=False)
# Insert the data:
for path in [
"/opt/caosdb/mnt/extroot/base/SimulationData",
"/opt/caosdb/mnt/extroot/base/DataAnalysis"]:
loadpath(
path=path,
include=None,
exclude=None,
prefix="/",
dryrun=False,
forceAllowSymlinks=False)
# Run the crawler:
run([
"crawler2.0",
"--debug",
'--load-identifiables=identifiables.yml',
"-s",
"--provenance=provenance.yml",
"simulation_cfood_baltasar.yml",
"extroot/"], cwd="use_case_cardiac_simulation",
check=True)
res = db.execute_query("FIND Record MonodomainTissueSimulationRun")
assert len(res) > 0
......@@ -2,4 +2,4 @@
# Run the crawler2.0 to test the data structure
# A. Schlemmer, 03/2022
crawler2.0 --debug --load-identifiables="identifiables.yml" -s --provenance=provenance.yml simulation_cfood_baltasar.yml ../../extroot/
crawler2.0 --debug --load-identifiables="identifiables.yml" -s --provenance=provenance.yml simulation_cfood_baltasar.yml extroot/
......@@ -2,7 +2,3 @@
# Insert the data model using the yaml interface
# A. Schlemmer, 02/2022
from caosadvancedtools.models import parser as parser
model = parser.parse_model_from_yaml("model.yml")
model.sync_data_model()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment