Skip to content
Snippets Groups Projects
Commit d187ec63 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: do not directly load the model but use the insert_model module"

parent 0d20f45b
No related branches found
No related tags found
2 merge requests!22Release 0.3,!19MAINT: further tests and docs
Pipeline #14859 passed
......@@ -5,6 +5,9 @@ from caosadvancedtools.cfoods.h5 import H5CFood
from caosadvancedtools.models.data_model import DataModel
from caosadvancedtools.models.parser import parse_model_from_yaml
def main():
# for teseting existing data model parts for the YANL Interface
db.RecordType(name="TestRT1", datatype=db.TEXT).insert()
db.Property(name="TestP1", datatype=db.TEXT).insert()
......@@ -21,6 +24,9 @@ h5model = db.Container()
h5file = h5py.File('extroot/ExperimentalData/2010_TestProject/2019-02-03/hdf5_dummy_file.hdf5', 'r')
H5CFood.create_structure(h5file, create_recordTypes=True, collection=h5model,
root_name="ExampleH5")
print(h5model)
h5model = DataModel(h5model)
h5model.sync_data_model(noquestion=True)
if __name__ == "__main__":
main()
......@@ -34,6 +34,8 @@ from caosadvancedtools.models.parser import parse_model_from_yaml
from caosadvancedtools.scifolder import (AnalysisCFood, ExperimentCFood,
PublicationCFood, SimulationCFood)
from insert_model import main as insert_model
def setup_module():
"""Clear problems and remove all entities except for built-in ones."""
......@@ -67,8 +69,7 @@ def test_crawler_with_data_model_problems():
prefix="", dryrun=False, forceAllowSymlinks=False)
# load and damage the model
model = parse_model_from_yaml("model.yml")
model.sync_data_model(noquestion=True)
insert_model()
deleted_entities = {"Experiment", "Poster", "results"}
for ent in deleted_entities:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment