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
Labels
Merge Requests
103
Merge Requests
103
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
0d9ff387
Commit
0d9ff387
authored
Aug 27, 2018
by
Łukasz Nowak
Committed by
Łukasz Nowak
Aug 31, 2018
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
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,
...
@@ -163,6 +163,8 @@ setup(name=name,
'request.serialised = slapos.recipe.request:RequestJSONEncoded'
,
'request.serialised = slapos.recipe.request:RequestJSONEncoded'
,
'request.edge = slapos.recipe.request:RequestEdge'
,
'request.edge = slapos.recipe.request:RequestEdge'
,
'requestoptional = slapos.recipe.request:RequestOptional'
,
'requestoptional = slapos.recipe.request:RequestOptional'
,
'requestoptional.serialised = '
'slapos.recipe.request:RequestOptionalJSONEncoded'
,
're6stnet.registry = slapos.recipe.re6stnet:Recipe'
,
're6stnet.registry = slapos.recipe.re6stnet:Recipe'
,
'reverseproxy.nginx = slapos.recipe.reverse_proxy_nginx:Recipe'
,
'reverseproxy.nginx = slapos.recipe.reverse_proxy_nginx:Recipe'
,
'seleniumrunner = slapos.recipe.seleniumrunner:Recipe'
,
'seleniumrunner = slapos.recipe.seleniumrunner:Recipe'
,
...
...
slapos/recipe/request.py
View file @
0d9ff387
...
@@ -280,6 +280,11 @@ class RequestJSONEncoded(JSONCodec, Recipe):
...
@@ -280,6 +280,11 @@ class RequestJSONEncoded(JSONCodec, Recipe):
"""
"""
pass
pass
class
RequestOptionalJSONEncoded
(
JSONCodec
,
RequestOptional
):
"""
Like RequestOptional, but serialised with JSONCodec.
"""
pass
CONNECTION_PARAMETER_STRING
=
'connection-'
CONNECTION_PARAMETER_STRING
=
'connection-'
...
...
slapos/test/recipe/test_request.py
View file @
0d9ff387
...
@@ -112,3 +112,10 @@ class RequestJSONEncodedTest(RecipeTestMixin, unittest.TestCase):
...
@@ -112,3 +112,10 @@ class RequestJSONEncodedTest(RecipeTestMixin, unittest.TestCase):
raises
=
True
raises
=
True
called_partition_parameter_kw
=
{
'_'
:
'{}'
}
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
=
{
'_'
:
'{}'
}
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