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
1c556931
Verified
Commit
1c556931
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Allowing Umlaut in cfood's $expression
parent
af715a5b
No related branches found
No related tags found
2 merge requests
!178
FIX: #96 Better error output for crawl.py script.
,
!169
Umlaut in cfood
Pipeline
#51342
passed with warnings
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
src/caoscrawler/converters.py
+1
-1
1 addition, 1 deletion
src/caoscrawler/converters.py
unittests/test_issues.py
+19
-5
19 additions, 5 deletions
unittests/test_issues.py
with
22 additions
and
6 deletions
CHANGELOG.md
+
2
−
0
View file @
1c556931
...
@@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ###
### Fixed ###
*
[
93
](
https://gitlab.com/linkahead/linkahead-crawler/-/issues/93
)
cfood.yaml does not allow umlaut in $expression
### Security ###
### Security ###
### Documentation ###
### Documentation ###
...
...
This diff is collapsed.
Click to expand it.
src/caoscrawler/converters.py
+
1
−
1
View file @
1c556931
...
@@ -53,7 +53,7 @@ from .utils import has_parent
...
@@ -53,7 +53,7 @@ from .utils import has_parent
# by the converters:
# by the converters:
SPECIAL_PROPERTIES
=
(
"
description
"
,
"
name
"
,
"
id
"
,
"
path
"
,
SPECIAL_PROPERTIES
=
(
"
description
"
,
"
name
"
,
"
id
"
,
"
path
"
,
"
file
"
,
"
checksum
"
,
"
size
"
)
"
file
"
,
"
checksum
"
,
"
size
"
)
SINGLE_VAR_RE
=
re
.
compile
(
r
"
^\$(\{)?(?P<varname>
[0-9a-zA-Z_]
+)(\})?$
"
)
SINGLE_VAR_RE
=
re
.
compile
(
r
"
^\$(\{)?(?P<varname>
\w
+)(\})?$
"
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
This diff is collapsed.
Click to expand it.
unittests/test_issues.py
+
19
−
5
View file @
1c556931
...
@@ -22,13 +22,11 @@
...
@@ -22,13 +22,11 @@
from
pytest
import
mark
from
pytest
import
mark
import
caosdb
as
db
from
caoscrawler.converters
import
replace_variables
from
caoscrawler.crawl
import
Crawler
from
caoscrawler.crawl
import
Crawler
from
caoscrawler.identifiable
import
Identifiable
from
caoscrawler.identifiable_adapters
import
CaosDBIdentifiableAdapter
from
caoscrawler.structure_elements
import
DictElement
from
caoscrawler.structure_elements
import
DictElement
from
caoscrawler.stores
import
GeneralStore
from
caoscrawler.scanner
import
create_converter_registry
,
scan_structure_elements
from
caoscrawler.scanner
import
create_converter_registry
,
scan_structure_elements
...
@@ -110,3 +108,19 @@ def test_list_datatypes():
...
@@ -110,3 +108,19 @@ def test_list_datatypes():
assert
isinstance
(
records
[
0
].
get_property
(
"
Subject
"
).
value
,
list
)
assert
isinstance
(
records
[
0
].
get_property
(
"
Subject
"
).
value
,
list
)
assert
records
[
0
].
get_property
(
"
Subject
"
).
datatype
is
not
None
assert
records
[
0
].
get_property
(
"
Subject
"
).
datatype
is
not
None
assert
records
[
0
].
get_property
(
"
Subject
"
).
datatype
.
startswith
(
"
LIST
"
)
assert
records
[
0
].
get_property
(
"
Subject
"
).
datatype
.
startswith
(
"
LIST
"
)
def
test_issue_93
():
"""
https://gitlab.com/linkahead/linkahead-crawler/-/issues/93
cfood.yaml does not allow umlaut in $expression
"""
values
=
GeneralStore
()
expressions
=
[
"
1
"
,
"
Ä
"
,
"
ųøîµ
"
,
]
for
exp
in
expressions
:
values
[
exp
]
=
f
"
This is
{
exp
}
"
for
exp
in
expressions
:
assert
replace_variables
(
f
"
$
{
exp
}
"
,
values
)
==
f
"
This is
{
exp
}
"
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