Commit c984a567 authored by Romain Courteaud's avatar Romain Courteaud

slapos_json_rpc_api: drop not expected property in the output

parent f89fc714
......@@ -88,7 +88,7 @@ for key, value in existing_partition_dict.items():
value.invalidate(comment="Desactivated by slapformat")
return {
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
#"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"compute_node_id": compute_node.getReference(),
"date": DateTime().ISO8601(),
"portal_type": "Compute Node",
......
......@@ -25,7 +25,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, TemporaryAlarmScript
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, TemporaryAlarmScript, PinnedDateTime
from DateTime import DateTime
......@@ -1253,38 +1253,29 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJsonRpcMixin):
self.person_user_id = self.person.getUserId()
def test_30_computerBang(self):
start_date = DateTime()
# XXX XXX XXX TODO pin datetime to check the result
error_log = 'Please force slapos node rerun'
response = self.callJsonRpcWebService(
"slapos.put.slapos_jio_api_put_compute_node",
{
"compute_node_id": self.compute_node_id,
"portal_type": "Compute Node",
"bang_status_message": error_log,
},
self.person_user_id
)
response_dict = json.loads(response.getBody())
with PinnedDateTime(self, DateTime('2020/05/19')):
response = self.callJsonRpcWebService(
"slapos.put.slapos_jio_api_put_compute_node",
{
"compute_node_id": self.compute_node_id,
"portal_type": "Compute Node",
"bang_status_message": error_log,
},
self.person_user_id
)
self.assertEqual('application/json', response.headers.get('content-type'))
"""
self.assertEqual(
response.getBody(),
json.dumps(
{
'type': 'success-type',
'title': "query completed",
'status': 200
}).encode())"""
'compute_node_id': self.compute_node.getReference(),
'date': '2020-05-19T00:00:00+00:00',
'portal_type': 'Compute Node',
'success': 'Done'
}).encode())
self.assertEqual(response.getStatus(), 200)
self.assertEqual(response_dict["compute_node_id"], self.compute_node.getReference().decode('UTF-8'))
self.assertEqual(response_dict["success"], "Done")
self.assertEqual(response_dict["portal_type"], "Compute Node")
self.assertTrue(response_dict["$schema"].endswith("ComputeNode_updateFromJSON/getOutputJSONSchema"))
self.assertTrue(DateTime(response_dict["date"]) >= DateTime(start_date.ISO8601()), response_dict["date"])
portal_workflow = self.portal.portal_workflow
comment = portal_workflow.getInfoFor(ob=self.compute_node,
name='comment',
......
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