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
04ade76d
Commit
04ade76d
authored
2 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
TST: Fix unittest
parent
189d2f2d
No related branches found
No related tags found
2 merge requests
!123
REL: Release v0.6.0
,
!107
ENH: setup logging and reporting for serverside execution
Pipeline
#35051
failed
2 years 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_tool.py
+8
-4
8 additions, 4 deletions
unittests/test_tool.py
with
8 additions
and
4 deletions
unittests/test_tool.py
+
8
−
4
View file @
04ade76d
...
...
@@ -29,7 +29,8 @@ import logging
from
caoscrawler.stores
import
GeneralStore
,
RecordStore
import
os
from
caoscrawler.crawl
import
Crawler
,
SecurityMode
,
split_restricted_path
from
caoscrawler.crawl
import
(
_treat_deprecated_prefix
,
Crawler
,
crawler_main
,
SecurityMode
,
split_restricted_path
)
from
caoscrawler.identifiable
import
Identifiable
from
caoscrawler.structure_elements
import
File
,
DictTextElement
,
DictListElement
,
DictElement
from
caoscrawler.scanner
import
scan_directory
...
...
@@ -39,7 +40,6 @@ from simulated_server_data import full_data
from
functools
import
partial
from
copy
import
deepcopy
from
unittest.mock
import
patch
from
caoscrawler.crawl
import
crawler_main
import
caosdb.common.models
as
dbmodels
from
unittest.mock
import
MagicMock
,
Mock
from
os.path
import
join
,
dirname
,
basename
...
...
@@ -994,10 +994,14 @@ def test_deprecated_prefix_option():
with
pytest
.
deprecated_call
():
crawler_main
(
"
./
"
,
rfp
(
"
scifolder_cfood.yml
"
),
prefix
=
"
to/be/removed
"
)
with
raises
(
ValueError
)
as
ve
:
crawler_main
(
"
./
"
,
rfp
(
"
scifolder_cfood.yml
"
),
prefix
=
"
to/be/removed
"
,
# Check that crawler main terminates with an error
assert
1
=
crawler_main
(
"
./
"
,
rfp
(
"
scifolder_cfood.yml
"
),
prefix
=
"
to/be/removed
"
,
remove_prefix
=
"
to/be/removed
"
)
with
raises
(
ValueError
)
as
ve
:
_treat_deprecated_prefix
(
prefix
=
"
to/be/removed
"
,
remove_prefix
=
"
to/be/removed
"
)
assert
"
(deprecated) `prefix` and the `remove_prefix`
"
in
str
(
ve
.
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