Commit 872bee12 authored by Romain Courteaud's avatar Romain Courteaud

erp5_json_rpc_api: test: wip

parent 53b535ad
...@@ -45,11 +45,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -45,11 +45,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
class JsonRpcAPITestCase(ERP5TypeTestCase): class JsonRpcAPITestCase(ERP5TypeTestCase):
"""
a
"""
class JsonRpcAPITestCase2(JsonRpcAPITestCase):
_type_id = 'JSON RPC API Test Service' _type_id = 'JSON RPC API Test Service'
def afterSetUp(self): def afterSetUp(self):
...@@ -108,6 +103,13 @@ class JsonRpcAPITestCase2(JsonRpcAPITestCase): ...@@ -108,6 +103,13 @@ class JsonRpcAPITestCase2(JsonRpcAPITestCase):
self.assertEqual(ret.getHeader('content-type'), 'text/html; charset=utf-8') self.assertEqual(ret.getHeader('content-type'), 'text/html; charset=utf-8')
self.assertIn(b'<html', ret.getBody()) self.assertIn(b'<html', ret.getBody())
ret = self.publish(
self.connector.getPath() + '/viewOpenAPIAsJson', user='ERP5TypeTestCase')
self.assertEqual(ret.getStatus(), 200)
body = json.load(io.BytesIO(ret.getBody()))
server_url = body['servers'][0]['url']
self.assertIn(self.connector.getPath(), server_url)
""" """
_type_id = NotImplemented # type: str _type_id = NotImplemented # type: str
_open_api_schema = NotImplemented # type: str _open_api_schema = NotImplemented # type: str
...@@ -159,7 +161,7 @@ class OpenAPIPetStoreTestCase(JsonRpcAPITestCase): ...@@ -159,7 +161,7 @@ class OpenAPIPetStoreTestCase(JsonRpcAPITestCase):
self.portal.portal_skins.erp5_open_api['test-petstore-swagger.json']) self.portal.portal_skins.erp5_open_api['test-petstore-swagger.json'])
class TestOpenAPIConnectorView(OpenAPIPetStoreTestCase): class TestJsonRpcAPIConnectorView(JsonRpcAPITestCase):
def test_view(self): def test_view(self):
ret = self.publish(self.connector.getPath(), user='ERP5TypeTestCase') ret = self.publish(self.connector.getPath(), user='ERP5TypeTestCase')
self.assertEqual(ret.getStatus(), 200) self.assertEqual(ret.getStatus(), 200)
......
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