Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
9a0af7be
Commit
9a0af7be
authored
Jan 21, 2020
by
Markus Scheidgen
Browse files
Added a log entry for code_args to debug.
parent
14ef76d8
Pipeline
#67479
canceled with stages
in 7 minutes and 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/app/api/repo.py
View file @
9a0af7be
...
...
@@ -232,6 +232,8 @@ class RepoCalcsResource(Resource):
code_args
=
dict
(
request
.
args
)
if
'statistics'
in
code_args
:
del
(
code_args
[
'statistics'
])
import
json
utils
.
get_logger
(
__name__
).
info
(
'create code snippets'
,
code_args
=
json
.
dumps
(
code_args
))
results
[
'curl'
]
=
query_api_curl
(
'archive'
,
'query'
,
query_string
=
code_args
)
results
[
'python'
]
=
query_api_python
(
'archive'
,
'query'
,
query_string
=
code_args
)
...
...
tests/app/test_api.py
View file @
9a0af7be
...
...
@@ -1076,13 +1076,11 @@ class TestRepo():
assert
data
[
'pagination'
][
'total'
]
>
0
def
test_get_code_from_query
(
self
,
api
,
example_elastic_calcs
,
test_user_auth
):
rv
=
api
.
get
(
'/repo/?
per_page=10
'
,
headers
=
test_user_auth
)
rv
=
api
.
get
(
'/repo/?
code_name=VASP
'
,
headers
=
test_user_auth
)
assert
rv
.
status_code
==
200
data
=
json
.
loads
(
rv
.
data
)
assert
data
[
'python'
]
is
not
None
assert
data
[
'curl'
]
is
not
None
# exec does not seem to work
# exec(data['python'])
class
TestEditRepo
():
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment