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
538aa080
Commit
538aa080
authored
Sep 21, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: test: SubscriptionRequest_verifyInstanceIsAllocated was dropped
parent
2deabf92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
92 deletions
+0
-92
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+0
-92
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
538aa080
...
...
@@ -711,98 +711,6 @@ class TestSubscriptionRequest_notifyInstanceIsReady(TestSubscriptionSkinsMixin):
self
.
instance_tree
.
getRelativeUrl
()))
class
TestSubscriptionRequest_verifyInstanceIsAllocated
(
TestSubscriptionSkinsMixin
):
@
simulate
(
'SoftwareInstance_hasReportedError'
,
''
,
'return False'
)
def
test_instance_tree
(
self
):
person
=
self
.
makePerson
()
subscription_request
=
self
.
newSubscriptionRequest
(
quantity
=
1
,
destination_section_value
=
person
,
url_string
=
"https://%s/software.cfg"
%
self
.
new_id
,
sla_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="oi">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
text_content
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="xx">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
root_slave
=
False
,
source_reference
=
"test_for_test_123"
)
self
.
_makeTree
()
subscription_request
.
edit
(
aggregate_value
=
self
.
instance_tree
)
# Ensure the requested instances aren't allocated
self
.
assertEqual
(
self
.
requested_software_instance
.
getAggregate
(),
None
)
self
.
assertEqual
(
self
.
software_instance
.
getAggregate
(),
None
)
self
.
tic
()
self
.
assertEqual
(
subscription_request
.
SubscriptionRequest_verifyInstanceIsAllocated
(),
False
)
def
_test_instance_tree
(
self
,
slave
=
False
):
person
=
self
.
makePerson
()
subscription_request
=
self
.
newSubscriptionRequest
(
quantity
=
1
,
destination_section_value
=
person
,
url_string
=
"https://%s/software.cfg"
%
self
.
new_id
,
sla_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="oi">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
text_content
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="xx">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
,
root_slave
=
False
,
source_reference
=
"test_for_test_123"
)
if
slave
:
self
.
_makeSlaveTree
()
_
,
p0
=
self
.
_makeComputeNode
()
self
.
software_instance
.
setAggregateValue
(
p0
)
self
.
requested_software_instance
.
setSpecialise
(
None
)
else
:
self
.
_makeTree
()
_
,
p0
=
self
.
_makeComputeNode
()
_
,
p1
=
self
.
_makeComputeNode
()
# Ensure the requested instances aren't allocated
self
.
requested_software_instance
.
setAggregateValue
(
p1
)
self
.
software_instance
.
setAggregateValue
(
p0
)
subscription_request
.
edit
(
aggregate_value
=
self
.
instance_tree
)
self
.
tic
()
return
subscription_request
@
simulate
(
'SoftwareInstance_hasReportedError'
,
''
,
'return True'
)
def
test_instance_tree_instance_with_error
(
self
):
subscription_request
=
self
.
_test_instance_tree
()
self
.
assertEqual
(
subscription_request
.
SubscriptionRequest_verifyInstanceIsAllocated
(),
False
)
@
simulate
(
'SoftwareInstance_hasReportedError'
,
''
,
'return False'
)
def
test_instance_tree_instance_without_error
(
self
):
subscription_request
=
self
.
_test_instance_tree
()
self
.
assertEqual
(
subscription_request
.
SubscriptionRequest_verifyInstanceIsAllocated
(),
True
)
@
simulate
(
'SoftwareInstance_hasReportedError'
,
''
,
'return True'
)
def
test_instance_tree_slave_with_error
(
self
):
subscription_request
=
self
.
_test_instance_tree
(
slave
=
True
)
self
.
assertEqual
(
subscription_request
.
SubscriptionRequest_verifyInstanceIsAllocated
(),
True
)
class
TestSlapOSSubscriptionRequestModule_getTicketFeedUrl
(
TestSubscriptionSkinsMixin
):
def
test_getTicketFeedUrl
(
self
):
...
...
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