Commit 2fa0c117 authored by Romain Courteaud's avatar Romain Courteaud

slapos_json_rpc_api: test

parent d9099b77
......@@ -117,9 +117,6 @@ class TestSlapOSJsonRpcMixin(SlapOSTestCaseMixin):
env={'CONTENT_TYPE': 'application/json'})
return response
def allDocsToApi(self, data_dict):
return self.callJsonRpcWebService('nope', data_dict)
def callUpdateRevision(self):
self.portal.portal_alarms.slapos_update_jio_api_revision_template.activeSense()
......@@ -257,11 +254,11 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
self.callUpdateRevisionAndTic()
self.login(self.compute_node_user_id)
software_list_response = self.allDocsToApi({
response = self.callJsonRpcWebService("slapos.allDocs.slapos_jio_api_search_software_installation", {
"compute_node_id": self.compute_node_id,
"portal_type": "Software Installation",
})
response = self.portal.REQUEST.RESPONSE
software_list_response = json.loads(response.getBody())
if 200 != response.getStatus():
raise ValueError("Unexpected Result %s" % software_list_response)
self.assertEqual('application/json',
......@@ -597,11 +594,11 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
self.callUpdateRevisionAndTic()
instance = self.start_requested_software_instance
self.login(instance.getUserId())
instance_list_response = self.allDocsToApi({
response = self.callJsonRpcWebService("slapos.allDocs.slapos_jio_api_search_instance", {
"compute_node_id": self.compute_node_id,
"portal_type": "Software Instance",
})
response = self.portal.REQUEST.RESPONSE
instance_list_response = json.loads(response.getBody())
if 200 != response.getStatus():
raise ValueError("Unexpected Result %s" % instance_list_response)
self.assertEqual('application/json',
......@@ -678,11 +675,11 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
# Check Slaves
self.login(instance.getUserId())
# XXX It should be the same portal_type
shared_instance_list_response = self.allDocsToApi({
response = self.callJsonRpcWebService("slapos.get.slapos_jio_api_get_software_instance", {
"host_instance_reference": instance.getReference(),
"portal_type": "Shared Instance",
})
response = self.portal.REQUEST.RESPONSE
shared_instance_list_response = json.loads(response.getBody())
if 200 != response.getStatus():
raise ValueError("Unexpected Result %s" % shared_instance_list_response)
self.assertEqual('application/json',
......
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