Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
87227272
Commit
87227272
authored
May 09, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover all marked cases.
parent
23dac070
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
7 deletions
+71
-7
master/bt5/vifib_slapos_rest_api_v1_test/TestTemplateItem/testVifibSlaposRestAPIV1.py
..._api_v1_test/TestTemplateItem/testVifibSlaposRestAPIV1.py
+70
-6
master/bt5/vifib_slapos_rest_api_v1_test/bt/revision
master/bt5/vifib_slapos_rest_api_v1_test/bt/revision
+1
-1
No files found.
master/bt5/vifib_slapos_rest_api_v1_test/TestTemplateItem/testVifibSlaposRestAPIV1.py
View file @
87227272
...
@@ -648,19 +648,83 @@ class TestInstancePOSTbang(VifibSlaposRestAPIV1BangMixin):
...
@@ -648,19 +648,83 @@ class TestInstancePOSTbang(VifibSlaposRestAPIV1BangMixin):
self
.
assertInstanceBangSimulatorEmpty
()
self
.
assertInstanceBangSimulatorEmpty
()
def
test_other_one
(
self
):
def
test_other_one
(
self
):
raise
NotImplementedError
kwargs
=
{
'log'
:
'This is cool log!'
}
person
,
person_reference
=
self
.
createPerson
()
self
.
connection
.
request
(
method
=
'POST'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getPredecessorRelatedValue
().
getRelativeUrl
(),
'bang'
]),
body
=
json
.
dumps
(
kwargs
),
headers
=
{
'REMOTE_USER'
:
person_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
self
.
assertInstanceBangSimulatorEmpty
()
def
test_no_json
(
self
):
def
test_no_json
(
self
):
raise
NotImplementedError
self
.
connection
.
request
(
method
=
'POST'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getRelativeUrl
(),
'bang'
]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
400
)
self
.
assertResponseJson
()
self
.
assertTrue
(
'error'
in
self
.
json_response
)
self
.
assertEqual
(
"Data is not json object."
,
self
.
json_response
[
'error'
])
self
.
assertInstanceBangSimulatorEmpty
()
def
test_bad_json
(
self
):
def
test_bad_json
(
self
):
raise
NotImplementedError
kwargs
=
{
'wrong_key'
:
'This is cool log!'
}
self
.
connection
.
request
(
method
=
'POST'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getPredecessorRelatedValue
().
getRelativeUrl
(),
'bang'
]),
body
=
json
.
dumps
(
kwargs
),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
400
)
self
.
assertResponseJson
()
self
.
assertEqual
({
'log'
:
'Missing.'
},
self
.
json_response
)
self
.
assertInstanceBangSimulatorEmpty
()
def
test_empty_json
(
self
):
def
test_empty_json
(
self
):
raise
NotImplementedError
kwargs
=
{}
self
.
connection
.
request
(
method
=
'POST'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getPredecessorRelatedValue
().
getRelativeUrl
(),
'bang'
]),
body
=
json
.
dumps
(
kwargs
),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
400
)
self
.
assertResponseJson
()
self
.
assertEqual
({
'log'
:
'Missing.'
},
self
.
json_response
)
self
.
assertInstanceBangSimulatorEmpty
()
def
test_additional_key_json
(
self
):
def
test_additional_key_json
(
self
):
raise
NotImplementedError
kw_log
=
{
'log'
:
'This is cool log!'
}
kwargs
=
kw_log
.
copy
()
kwargs
.
update
(
**
{
'wrong_key'
:
'Be ignored'
})
self
.
connection
.
request
(
method
=
'POST'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getRelativeUrl
(),
'bang'
]),
body
=
json
.
dumps
(
kwargs
),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
204
)
self
.
assertInstanceBangSimulator
((),
kw_log
)
def
test_log_not_string
(
self
):
def
test_log_not_string
(
self
):
raise
NotImplementedError
kwargs
=
{
'log'
:
True
}
self
.
connection
.
request
(
method
=
'POST'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getPredecessorRelatedValue
().
getRelativeUrl
(),
'bang'
]),
body
=
json
.
dumps
(
kwargs
),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
400
)
self
.
assertResponseJson
()
self
.
assertEqual
({
'log'
:
'Not a string.'
},
self
.
json_response
)
self
.
assertInstanceBangSimulatorEmpty
()
master/bt5/vifib_slapos_rest_api_v1_test/bt/revision
View file @
87227272
24
25
\ No newline at end of file
\ No newline at end of file
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