Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Takoudjou
slapos
Commits
0d9ff387
Commit
0d9ff387
authored
6 years ago
by
Łukasz Nowak
Committed by
Łukasz Nowak
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.recipe.request: Add requestoptional.serialised
It is combination of requestoptional and serialised.
parent
8eb13ef2
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
setup.py
setup.py
+2
-0
slapos/recipe/request.py
slapos/recipe/request.py
+5
-0
slapos/test/recipe/test_request.py
slapos/test/recipe/test_request.py
+7
-0
No files found.
setup.py
View file @
0d9ff387
...
...
@@ -163,6 +163,8 @@ setup(name=name,
'request.serialised = slapos.recipe.request:RequestJSONEncoded'
,
'request.edge = slapos.recipe.request:RequestEdge'
,
'requestoptional = slapos.recipe.request:RequestOptional'
,
'requestoptional.serialised = '
'slapos.recipe.request:RequestOptionalJSONEncoded'
,
're6stnet.registry = slapos.recipe.re6stnet:Recipe'
,
'reverseproxy.nginx = slapos.recipe.reverse_proxy_nginx:Recipe'
,
'seleniumrunner = slapos.recipe.seleniumrunner:Recipe'
,
...
...
This diff is collapsed.
Click to expand it.
slapos/recipe/request.py
View file @
0d9ff387
...
...
@@ -280,6 +280,11 @@ class RequestJSONEncoded(JSONCodec, Recipe):
"""
pass
class
RequestOptionalJSONEncoded
(
JSONCodec
,
RequestOptional
):
"""
Like RequestOptional, but serialised with JSONCodec.
"""
pass
CONNECTION_PARAMETER_STRING
=
'connection-'
...
...
This diff is collapsed.
Click to expand it.
slapos/test/recipe/test_request.py
View file @
0d9ff387
...
...
@@ -112,3 +112,10 @@ class RequestJSONEncodedTest(RecipeTestMixin, unittest.TestCase):
raises
=
True
called_partition_parameter_kw
=
{
'_'
:
'{}'
}
class
RequestOptionalJSONEncodedTest
(
RecipeTestMixin
,
unittest
.
TestCase
):
recipe
=
request
.
RequestOptionalJSONEncoded
return_value_empty
=
"{}"
return_value
=
'{"anything": "done"}'
raises
=
False
called_partition_parameter_kw
=
{
'_'
:
'{}'
}
This diff is collapsed.
Click to expand it.
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