Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jochem Bijlard
fractalis
Commits
ca3a115e
Commit
ca3a115e
authored
Feb 06, 2018
by
Sascha Herzinger
Browse files
Fixed some minor parsing issues in state controller
parent
6c555d52
Changes
2
Hide whitespace changes
Inline
Side-by-side
fractalis/state/controller.py
View file @
ca3a115e
...
...
@@ -77,7 +77,7 @@ def request_state_access(state_id: UUID) -> Tuple[Response, int]:
logger
.
error
(
error
)
return
jsonify
({
'error'
:
error
}),
404
descriptors
=
[]
matches
=
re
.
findall
(
'\$.+?\$'
,
value
)
matches
=
re
.
findall
(
'\$.+?\$'
,
str
(
json
.
loads
(
value
)
))
for
match
in
matches
:
task_id
,
_
=
AnalyticTask
.
parse_value
(
match
)
value
=
redis
.
get
(
'data:{}'
.
format
(
task_id
))
...
...
tests/functional/test_state.py
View file @
ca3a115e
...
...
@@ -74,7 +74,8 @@ class TestState:
def
test_error_if_task_id_is_no_etl_id
(
self
,
test_client
):
uuid
=
str
(
uuid4
())
redis
.
set
(
'state:{}'
.
format
(
uuid
),
'$123$'
)
redis
.
set
(
name
=
'state:{}'
.
format
(
uuid
),
value
=
json
.
dumps
({
'foo'
:
'$123$'
}))
rv
=
test_client
.
post
(
'/state/{}'
.
format
(
uuid
),
data
=
flask
.
json
.
dumps
(
{
'handler'
:
''
,
'server'
:
''
,
'auth'
:
{
'token'
:
''
}}))
body
=
flask
.
json
.
loads
(
rv
.
get_data
())
...
...
@@ -88,7 +89,8 @@ class TestState:
redis
.
set
(
name
=
'data:123'
,
value
=
json
.
dumps
(
{
'meta'
:
{
'descriptor'
:
{
'data_type'
:
'default'
}}}))
redis
.
set
(
name
=
'state:{}'
.
format
(
uuid
),
value
=
'$123$'
)
redis
.
set
(
name
=
'state:{}'
.
format
(
uuid
),
value
=
json
.
dumps
({
'foo'
:
'$123$'
}))
rv
=
test_client
.
post
(
'/state/{}'
.
format
(
uuid
),
data
=
flask
.
json
.
dumps
(
{
'handler'
:
'test'
,
'server'
:
'foo'
,
'auth'
:
{
'token'
:
''
}}))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment