Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
a679fb7b
Commit
a679fb7b
authored
8 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Also cover macros in cfood schema
parent
3e9afb08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!178
FIX: #96 Better error output for crawl.py script.
,
!163
F dict heuristic
Pipeline
#54402
failed
8 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/caoscrawler/cfood-schema.yml
+4
-0
4 additions, 0 deletions
src/caoscrawler/cfood-schema.yml
unittests/test_macros.py
+13
-6
13 additions, 6 deletions
unittests/test_macros.py
with
17 additions
and
6 deletions
src/caoscrawler/cfood-schema.yml
+
4
−
0
View file @
a679fb7b
...
...
@@ -2,6 +2,7 @@ cfood:
type
:
object
properties
:
Converters
:
description
:
Defintiion of custom converters
type
:
object
additionalProperties
:
type
:
object
...
...
@@ -13,6 +14,9 @@ cfood:
required
:
-
converter
-
package
macros
:
description
:
Macro definitions
type
:
array
additionalProperties
:
$ref
:
"
#/$defs/converter"
...
...
This diff is collapsed.
Click to expand it.
unittests/test_macros.py
+
13
−
6
View file @
a679fb7b
...
...
@@ -59,7 +59,7 @@ def _temp_file_load(txt: str):
def
test_macros
(
register_macros
,
macro_store_reset
):
dat
=
yaml
.
load
(
"""
def
s:
macro
s:
- !defmacro
name: test
params:
...
...
@@ -85,7 +85,7 @@ testnode:
def
test_macro_list_replacment
(
register_macros
,
macro_store_reset
):
dat
=
yaml
.
load
(
"""
def
s:
macro
s:
- !defmacro
name: test
params:
...
...
@@ -112,7 +112,7 @@ testnode:
def
test_multi_macros
(
register_macros
,
macro_store_reset
):
dat
=
yaml
.
load
(
"""
def
s:
macro
s:
- !defmacro
name: test_one
params: {}
...
...
@@ -194,6 +194,7 @@ metadata:
name: test_one
params: {}
definition:
type: TextElement
replaced1: ok
- !defmacro
name: test_two
...
...
@@ -213,6 +214,7 @@ extroot:
extroot2: !macro # test top level macro
test_one:
extroot3:
type: Directory
subtree:
SimulationData: !macro
test_two:
...
...
@@ -228,7 +230,7 @@ def test_replace_arbitrary_objects(register_macros, macro_store_reset):
See: https://gitlab.indiscale.com/caosdb/src/caosdb-crawler/-/issues/24
"""
dat
=
yaml
.
load
(
"""
def
s:
macro
s:
- !defmacro
name: test
params:
...
...
@@ -277,6 +279,7 @@ metadata:
params:
a: 25
definition:
type: DictElement
macro_sub_$a:
b: $a
another_param: 3
...
...
@@ -284,6 +287,7 @@ metadata:
name: test_macrodef
params: {}
definition:
type: DictElement
macro_top: !macro
one_macro:
- a: 17
...
...
@@ -352,6 +356,7 @@ metadata:
name: test_one
params: {}
definition: !macro
type: TextElement
test_two:
- !defmacro
name: test_two
...
...
@@ -367,6 +372,7 @@ metadata:
name: test_four
params: {}
definition: !macro
type: TextElement
test_four:
---
extroot: !macro
...
...
@@ -403,6 +409,7 @@ metadata:
macro_name: default_name
a: 4
definition:
type: DictElement
$macro_name:
something:
a: $a
...
...
@@ -555,7 +562,7 @@ extroot: !macro
def
test_list_macro_application
(
register_macros
,
macro_store_reset
):
dat
=
yaml
.
load
(
"""
def
s:
macro
s:
- !defmacro
name: test
params:
...
...
@@ -586,7 +593,7 @@ testnode:
def
test_variable_in_macro_definition
(
register_macros
,
macro_store_reset
):
dat
=
yaml
.
load
(
"""
def
s:
macro
s:
- !defmacro
name: test
params:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment