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
34dc48a5
Commit
34dc48a5
authored
5 months ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
TST: Make file paths Windows-compatible
parent
e5d75eb6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!217
TST: Make NamedTemporaryFiles Windows-compatible
,
!207
Resolve "Failing unit tests on Windows"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
unittests/test_crawler.py
+3
-3
3 additions, 3 deletions
unittests/test_crawler.py
unittests/test_scanner.py
+4
-4
4 additions, 4 deletions
unittests/test_scanner.py
unittests/test_utilities.py
+10
-10
10 additions, 10 deletions
unittests/test_utilities.py
with
17 additions
and
17 deletions
unittests/test_crawler.py
+
3
−
3
View file @
34dc48a5
...
...
@@ -824,9 +824,9 @@ def test_restricted_path(create_mock):
def
test_split_restricted_path
():
assert
[
"
el
"
]
==
split_restricted_path
(
"
/
el
"
)
assert
[
"
el
"
]
==
split_restricted_path
(
"
/el/
"
)
assert
[
"
el
"
,
"
el
"
]
==
split_restricted_path
(
"
/el/
el
"
)
assert
[
"
el
"
]
==
split_restricted_path
(
os
.
path
.
sep
+
"
el
"
)
assert
[
"
el
"
]
==
split_restricted_path
(
os
.
path
.
sep
+
"
el
"
+
os
.
path
.
sep
)
assert
[
"
el
"
,
"
el
"
]
==
split_restricted_path
(
os
.
path
.
sep
+
"
el
"
+
os
.
path
.
sep
+
"
el
"
)
# Filter the warning because we want to have it here and this way it does not hinder running
...
...
This diff is collapsed.
Click to expand it.
unittests/test_scanner.py
+
4
−
4
View file @
34dc48a5
...
...
@@ -30,7 +30,7 @@ from functools import partial
from
pathlib
import
Path
from
tempfile
import
NamedTemporaryFile
from
unittest.mock
import
MagicMock
,
Mock
,
patch
import
os
import
linkahead
as
db
import
pytest
import
yaml
...
...
@@ -110,7 +110,7 @@ def test_record_structure_generation():
assert
len
(
subc
[
1
])
==
0
# The data analysis node creates one variable for the node itself:
assert
subd
[
0
][
"
DataAnalysis
"
]
==
"
examples_article
/
DataAnalysis
"
assert
subd
[
0
][
"
DataAnalysis
"
]
==
os
.
path
.
join
(
"
examples_article
"
,
"
DataAnalysis
"
)
assert
subc
[
0
][
"
DataAnalysis
"
]
is
False
subd
=
dbt
.
debug_tree
[
dircheckstr
(
"
DataAnalysis
"
,
"
2020_climate-model-predict
"
)]
...
...
@@ -128,9 +128,9 @@ def test_record_structure_generation():
assert
subd
[
0
][
"
identifier
"
]
==
"
climate-model-predict
"
assert
subd
[
0
][
"
Project
"
].
__class__
==
db
.
Record
assert
subd
[
0
][
"
DataAnalysis
"
]
==
"
examples_article
/
DataAnalysis
"
assert
subd
[
0
][
"
DataAnalysis
"
]
==
os
.
path
.
join
(
"
examples_article
"
,
"
DataAnalysis
"
)
assert
subc
[
0
][
"
DataAnalysis
"
]
is
True
assert
subd
[
0
][
"
project_dir
"
]
==
"
examples_article
/
DataAnalysis
/
2020_climate-model-predict
"
assert
subd
[
0
][
"
project_dir
"
]
==
os
.
path
.
join
(
"
examples_article
"
,
"
DataAnalysis
"
,
"
2020_climate-model-predict
"
)
assert
subc
[
0
][
"
project_dir
"
]
is
False
# Check the copy flags for the first level in the hierarchy:
...
...
This diff is collapsed.
Click to expand it.
unittests/test_utilities.py
+
10
−
10
View file @
34dc48a5
...
...
@@ -20,22 +20,22 @@
#
import
pytest
from
os.path
import
sep
from
caoscrawler.crawl
import
split_restricted_path
from
caoscrawler.utils
import
MissingImport
,
get_shared_resource_link
def
test_split_restricted_path
():
assert
split_restricted_path
(
""
)
==
[]
assert
split_restricted_path
(
"
/
"
)
==
[]
assert
split_restricted_path
(
"
test
/
"
)
==
[
"
test
"
]
assert
split_restricted_path
(
"
/test/
"
)
==
[
"
test
"
]
assert
split_restricted_path
(
"
test
/
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
"
/test/
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
"
/test1/test2/
bla
"
)
==
[
"
test1
"
,
"
test2
"
,
"
bla
"
]
assert
split_restricted_path
(
"
/test//
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
"
//test/
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
"
///test//bla////
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
f
"
{
sep
}
"
)
==
[]
assert
split_restricted_path
(
f
"
test
{
sep
}
"
)
==
[
"
test
"
]
assert
split_restricted_path
(
f
"
{
sep
}
test
{
sep
}
"
)
==
[
"
test
"
]
assert
split_restricted_path
(
f
"
test
{
sep
}
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
f
"
{
sep
}
test
{
sep
}
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
f
"
{
sep
}
test1
{
sep
}
test2
{
sep
}
bla
"
)
==
[
"
test1
"
,
"
test2
"
,
"
bla
"
]
assert
split_restricted_path
(
f
"
{
sep
}
test
{
sep
}{
sep
}
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
f
"
{
sep
}{
sep
}
test
{
sep
}
bla
"
)
==
[
"
test
"
,
"
bla
"
]
assert
split_restricted_path
(
f
"
{
sep
}{
sep
}{
sep
}
test
{
sep
}{
sep
}
bla
{
sep
}{
sep
}{
sep
}{
sep
}
"
)
==
[
"
test
"
,
"
bla
"
]
def
test_dummy_class
():
...
...
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