Commit ca3a115e authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Fixed some minor parsing issues in state controller

parent 6c555d52
......@@ -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))
......
......@@ -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': ''}}))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment