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
0
Merge Requests
0
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
Titouan Soulard
slapos.core
Commits
25ec1d12
Commit
25ec1d12
authored
May 08, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Add test for SoftwareProduct_getSoftwareReleaseAsHateoas
parent
65cfd8d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
2 deletions
+61
-2
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+0
-1
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+61
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
25ec1d12
...
...
@@ -259,7 +259,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_hal_json_style/SaleInvoiceTransaction_getRelatedPaymentTransactionIntegrationId'
,
'slapos_hal_json_style/SoftwareInstallation_getSoftwareReleaseInformation'
,
'slapos_hal_json_style/SoftwareInstance_getReportedState'
,
'slapos_hal_json_style/SoftwareProduct_getSoftwareReleaseAsHateoas'
,
'slapos_hal_json_style/SoftwareRelease_requestInstanceTree'
,
'slapos_hal_json_style/SoftwareRelease_requestSoftwareInstallation'
,
'slapos_hal_json_style/SupportRequest_close'
,
...
...
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
25ec1d12
...
...
@@ -1739,4 +1739,64 @@ class TestInstanceTree_getFastInputDict(TestSlapOSHalJsonStyleMixin):
self
.
assertEqual
({
'enabled'
:
True
,
'sla_xml'
:
'<parameter id="instance_guid">%s</parameter>'
%
software_instance
.
getReference
()
},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
\ No newline at end of file
},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
class
TestSoftwareProduct_getSoftwareReleaseAsHateoas
(
TestSlapOSHalJsonStyleMixin
):
@
simulate
(
'SoftwareProduct_getSortedSoftwareReleaseList'
,
'software_product_reference=None, software_release_url=None, strict=None'
,
"""
assert software_product_reference == 'fake'
assert software_release_url is None
assert strict is None
return context.REQUEST['test_software_release_list']"""
)
def
test_product_reference
(
self
):
sr
=
self
.
_makeSoftwareRelease
()
self
.
changeSkin
(
'RJS'
)
self
.
portal
.
REQUEST
[
'test_software_release_list'
]
=
[
sr
]
self
.
assertEqual
(
sr
.
getRelativeUrl
(),
json
.
loads
(
self
.
portal
.
SoftwareProduct_getSoftwareReleaseAsHateoas
(
"product.fake"
))
)
@
simulate
(
'SoftwareProduct_getSortedSoftwareReleaseList'
,
'software_product_reference=None, software_release_url=None, strict=None'
,
"""
assert software_product_reference is None
assert software_release_url == 'fake'
assert strict is False
return context.REQUEST['test_software_release_list']"""
)
def
test_software_release
(
self
):
sr
=
self
.
_makeSoftwareRelease
()
self
.
changeSkin
(
'RJS'
)
self
.
portal
.
REQUEST
[
'test_software_release_list'
]
=
[
sr
]
self
.
assertEqual
(
sr
.
getRelativeUrl
(),
json
.
loads
(
self
.
portal
.
SoftwareProduct_getSoftwareReleaseAsHateoas
(
"fake"
))
)
@
simulate
(
'SoftwareProduct_getSortedSoftwareReleaseList'
,
'software_product_reference=None, software_release_url=None, strict=None'
,
"""
assert software_product_reference is None
assert software_release_url == 'fake'
assert strict is True
return []"""
)
def
test_software_release_not_found
(
self
):
self
.
changeSkin
(
'RJS'
)
self
.
assertEqual
(
''
,
json
.
loads
(
self
.
portal
.
SoftwareProduct_getSoftwareReleaseAsHateoas
(
"fake"
,
True
))
)
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