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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
872bee12
Commit
872bee12
authored
Nov 27, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_json_rpc_api: test: wip
parent
53b535ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
master/bt5/erp5_json_rpc_api/TestTemplateItem/portal_components/test.erp5.testJsonRpcAPIService.py
...Item/portal_components/test.erp5.testJsonRpcAPIService.py
+8
-6
No files found.
master/bt5/erp5_json_rpc_api/TestTemplateItem/portal_components/test.erp5.testJsonRpcAPIService.py
View file @
872bee12
...
...
@@ -45,11 +45,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
class
JsonRpcAPITestCase
(
ERP5TypeTestCase
):
"""
a
"""
class
JsonRpcAPITestCase2
(
JsonRpcAPITestCase
):
_type_id
=
'JSON RPC API Test Service'
def
afterSetUp
(
self
):
...
...
@@ -108,6 +103,13 @@ class JsonRpcAPITestCase2(JsonRpcAPITestCase):
self
.
assertEqual
(
ret
.
getHeader
(
'content-type'
),
'text/html; charset=utf-8'
)
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
_open_api_schema = NotImplemented # type: str
...
...
@@ -159,7 +161,7 @@ class OpenAPIPetStoreTestCase(JsonRpcAPITestCase):
self
.
portal
.
portal_skins
.
erp5_open_api
[
'test-petstore-swagger.json'
])
class
Test
OpenAPIConnectorView
(
OpenAPIPetStore
TestCase
):
class
Test
JsonRpcAPIConnectorView
(
JsonRpcAPI
TestCase
):
def
test_view
(
self
):
ret
=
self
.
publish
(
self
.
connector
.
getPath
(),
user
=
'ERP5TypeTestCase'
)
self
.
assertEqual
(
ret
.
getStatus
(),
200
)
...
...
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