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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
21cdcd0c
Commit
21cdcd0c
authored
9 months ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
TST(converters): test for generating children of ROCrate entities
parent
ccb65a96
No related branches found
No related tags found
2 merge requests
!198
REL: Release 0.10.0
,
!193
ROCrate-Converter (also for .eln-files)
Pipeline
#57208
failed
9 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittests/test_rocrate_converter.py
+27
-1
27 additions, 1 deletion
unittests/test_rocrate_converter.py
with
27 additions
and
1 deletion
unittests/test_rocrate_converter.py
+
27
−
1
View file @
21cdcd0c
...
@@ -39,7 +39,7 @@ from rocrate.model.entity import Entity
...
@@ -39,7 +39,7 @@ from rocrate.model.entity import Entity
from
caoscrawler.converters
import
(
ELNFileConverter
,
ROCrateEntityConverter
)
from
caoscrawler.converters
import
(
ELNFileConverter
,
ROCrateEntityConverter
)
from
caoscrawler.scanner
import
load_definition
from
caoscrawler.scanner
import
load_definition
from
caoscrawler.stores
import
GeneralStore
from
caoscrawler.stores
import
GeneralStore
from
caoscrawler.structure_elements
import
ROCrateEntity
,
File
from
caoscrawler.structure_elements
import
ROCrateEntity
,
File
,
TextElement
,
DictElement
UNITTESTDIR
=
Path
(
__file__
).
parent
UNITTESTDIR
=
Path
(
__file__
).
parent
...
@@ -114,7 +114,33 @@ def test_match_rocrate_entities(eln_entities):
...
@@ -114,7 +114,33 @@ def test_match_rocrate_entities(eln_entities):
type: ROCrateEntity
type: ROCrateEntity
match_properties:
match_properties:
"
@id
"
:
\\
./
"
@id
"
:
\\
./
datePublished: (?P<datePublished>.*)
"""
),
"
TestELNConverter
"
,
converter_registry
)
"""
),
"
TestELNConverter
"
,
converter_registry
)
match
=
ds1
.
match
(
eln_entities
[
0
])
match
=
ds1
.
match
(
eln_entities
[
0
])
assert
match
is
not
None
assert
match
is
not
None
ds2
=
ROCrateEntityConverter
(
yaml
.
safe_load
(
"""
type: ROCrateEntity
match_type: CreativeWork
match_properties:
"
@id
"
: ro-crate-metadata.json
dateCreated: (?P<dateCreated>.*)
"""
),
"
TestELNConverter
"
,
converter_registry
)
match
=
ds2
.
match
(
eln_entities
[
0
])
assert
match
is
None
match
=
ds1
.
match
(
eln_entities
[
1
])
assert
match
is
None
match
=
ds2
.
match
(
eln_entities
[
1
])
assert
match
is
not
None
assert
match
[
"
dateCreated
"
]
==
"
2024-08-21T12:07:45.115990+00:00
"
children
=
ds2
.
create_children
(
GeneralStore
(),
eln_entities
[
1
])
assert
len
(
children
)
==
7
assert
isinstance
(
children
[
0
],
TextElement
)
assert
children
[
0
].
name
==
"
@id
"
assert
children
[
0
].
value
==
"
ro-crate-metadata.json
"
assert
isinstance
(
children
[
5
],
DictElement
)
assert
children
[
5
].
value
==
{
'
@id
'
:
'
https://kadi.iam.kit.edu
'
}
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