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
01329a91
Commit
01329a91
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
FIX: move test for remove_prefix to int tests
parent
e12ede01
No related branches found
No related tags found
2 merge requests
!105
REL: v0.4.0
,
!101
ENH: add the 'add_prefix' argument
Pipeline
#34103
passed
2 years 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
integrationtests/test_use_case_simple_presentation.py
+12
-3
12 additions, 3 deletions
integrationtests/test_use_case_simple_presentation.py
unittests/test_tool.py
+0
-13
0 additions, 13 deletions
unittests/test_tool.py
with
12 additions
and
16 deletions
integrationtests/test_use_case_simple_presentation.py
+
12
−
3
View file @
01329a91
...
@@ -38,9 +38,7 @@ DATADIR = os.path.join(os.path.dirname(__file__), "test_data",
...
@@ -38,9 +38,7 @@ DATADIR = os.path.join(os.path.dirname(__file__), "test_data",
"
extroot
"
,
"
use_case_simple_presentation
"
)
"
extroot
"
,
"
use_case_simple_presentation
"
)
def
test_complete_crawler
(
def
test_complete_crawler
(
clear_database
):
clear_database
):
# Setup the data model:
# Setup the data model:
model
=
parser
.
parse_model_from_yaml
(
os
.
path
.
join
(
DATADIR
,
"
model.yml
"
))
model
=
parser
.
parse_model_from_yaml
(
os
.
path
.
join
(
DATADIR
,
"
model.yml
"
))
model
.
sync_data_model
(
noquestion
=
True
,
verbose
=
False
)
model
.
sync_data_model
(
noquestion
=
True
,
verbose
=
False
)
...
@@ -57,6 +55,17 @@ def test_complete_crawler(
...
@@ -57,6 +55,17 @@ def test_complete_crawler(
dryrun
=
False
,
dryrun
=
False
,
forceAllowSymlinks
=
False
)
forceAllowSymlinks
=
False
)
# test that a bad value for "remove_prefix" leads to runtime error
with
pytest
.
raises
(
RuntimeError
)
as
re
:
crawler_main
(
DATADIR
,
os
.
path
.
join
(
DATADIR
,
"
cfood.yml
"
),
os
.
path
.
join
(
DATADIR
,
"
identifiables.yml
"
),
True
,
os
.
path
.
join
(
DATADIR
,
"
provenance.yml
"
),
False
,
remove_prefix
=
"
sldkfjsldf
"
)
assert
"
path does not start with the prefix
"
in
str
(
re
.
value
)
crawler_main
(
DATADIR
,
crawler_main
(
DATADIR
,
os
.
path
.
join
(
DATADIR
,
"
cfood.yml
"
),
os
.
path
.
join
(
DATADIR
,
"
cfood.yml
"
),
os
.
path
.
join
(
DATADIR
,
"
identifiables.yml
"
),
os
.
path
.
join
(
DATADIR
,
"
identifiables.yml
"
),
...
...
This diff is collapsed.
Click to expand it.
unittests/test_tool.py
+
0
−
13
View file @
01329a91
...
@@ -982,16 +982,3 @@ def test_deprecated_prefix_option():
...
@@ -982,16 +982,3 @@ def test_deprecated_prefix_option():
remove_prefix
=
"
to/be/removed
"
)
remove_prefix
=
"
to/be/removed
"
)
assert
"
(deprecated) `prefix` and the `remove_prefix`
"
in
str
(
ve
.
value
)
assert
"
(deprecated) `prefix` and the `remove_prefix`
"
in
str
(
ve
.
value
)
def
test_wrong_remove_prefix_option
():
"""
Test that calling the crawler
'
s main function with `remove_prefix` option
with a bad value raises the correct error.
"""
with
raises
(
RuntimeError
)
as
re
:
crawler_main
(
rfp
(
"
test_directories
"
,
"
examples_article
"
),
rfp
(
"
scifolder_extended.yml
"
),
remove_prefix
=
"
to/be/removed
"
)
assert
"
path does not start with the prefix
"
in
str
(
re
.
value
)
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