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
357aa49b
Commit
357aa49b
authored
Mar 13, 2024
by
Titouan Soulard
Committed by
Romain Courteaud
Nov 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio_api_style: update tests after rebase
parent
784754e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
master/bt5/slapos_jio_api_style/TestTemplateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
...plateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
+5
-10
No files found.
master/bt5/slapos_jio_api_style/TestTemplateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
View file @
357aa49b
...
@@ -86,14 +86,8 @@ class TestSlapOSJIOAPIMixin(SlapOSTestCaseMixin):
...
@@ -86,14 +86,8 @@ class TestSlapOSJIOAPIMixin(SlapOSTestCaseMixin):
self
.
commit
()
self
.
commit
()
# Prepare compute_node
# Prepare compute_node
self
.
compute_node
=
self
.
portal
.
compute_node_module
.
template_compute_node
\
compute_node
,
_
=
self
.
addComputeNodeAndPartition
(
self
.
project
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
compute_node
=
compute_node
self
.
compute_node
.
edit
(
title
=
"Compute Node %s"
%
self
.
new_id
,
reference
=
"TESTCOMP-%s"
%
self
.
new_id
,
follow_up_value
=
self
.
project
)
self
.
compute_node
.
validate
()
# Make compute node access
# Make compute node access
self
.
_addCertificateLogin
(
self
.
compute_node
)
self
.
_addCertificateLogin
(
self
.
compute_node
)
...
@@ -131,6 +125,7 @@ class TestSlapOSJIOAPIMixin(SlapOSTestCaseMixin):
...
@@ -131,6 +125,7 @@ class TestSlapOSJIOAPIMixin(SlapOSTestCaseMixin):
def
allDocsToApi
(
self
,
data_dict
):
def
allDocsToApi
(
self
,
data_dict
):
self
.
portal
.
REQUEST
.
set
(
"live_test"
,
True
)
self
.
portal
.
REQUEST
.
set
(
"live_test"
,
True
)
self
.
portal
.
REQUEST
.
set
(
"BODY"
,
json
.
dumps
(
data_dict
))
self
.
portal
.
REQUEST
.
set
(
"BODY"
,
json
.
dumps
(
data_dict
))
self
.
portal
.
REQUEST
.
set
(
"REQUEST_METHOD"
,
"POST"
)
return
json_loads_byteified
(
self
.
web_site
.
api
.
allDocs
())
return
json_loads_byteified
(
self
.
web_site
.
api
.
allDocs
())
def
callUpdateRevision
(
self
):
def
callUpdateRevision
(
self
):
...
@@ -190,7 +185,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
...
@@ -190,7 +185,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
"compute_node_id"
:
self
.
compute_node_id
,
"compute_node_id"
:
self
.
compute_node_id
,
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
})
})
response
=
self
.
portal
.
REQUEST
.
RESPONSE
response
=
self
.
portal
.
REQUEST
.
RESPONSE
if
200
!=
response
.
getStatus
():
if
200
!=
response
.
getStatus
():
raise
ValueError
(
"Unexpected Result %s"
%
instance_list_response
)
raise
ValueError
(
"Unexpected Result %s"
%
instance_list_response
)
self
.
assertEqual
(
'application/json'
,
self
.
assertEqual
(
'application/json'
,
...
@@ -200,7 +195,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
...
@@ -200,7 +195,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
result_list
=
instance_list_response
[
"result_list"
]
result_list
=
instance_list_response
[
"result_list"
]
self
.
assertEqual
(
3
,
len
(
result_list
))
self
.
assertEqual
(
3
,
len
(
result_list
))
# This is the expected instance list, it is sorted by api_revision
# This is the expected instance list, it is sorted by api_revision
instance_list
=
[
instance_1
,
instance_2
,
instance_3
]
instance_list
=
[
instance_1
,
instance_2
,
instance_3
]
instance_list
.
sort
(
key
=
lambda
x
:
x
.
getJIOAPIRevision
(
self
.
web_site
.
api
.
getRelativeUrl
()))
instance_list
.
sort
(
key
=
lambda
x
:
x
.
getJIOAPIRevision
(
self
.
web_site
.
api
.
getRelativeUrl
()))
...
...
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