Commit 89d11482 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_pdm (test): simulate HS_isUpgradePossible to not overkill the test

This script is tested separatetly
parent 4fdc257d
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
# #
# Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved. # Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved.
# #
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
############################################################################## ##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
......
...@@ -464,8 +464,9 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -464,8 +464,9 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_software_release = upgrade_decision.UpgradeDecision_getSoftwareRelease() found_software_release = upgrade_decision.UpgradeDecision_getSoftwareRelease()
self.assertEqual(None, found_software_release) self.assertEqual(None, found_software_release)
@simulate('HostingSubscription_isUpgradePossible',
'software_release_url', 'return 1')
def testUpgradeDecision_upgradeHostingSubscription(self): def testUpgradeDecision_upgradeHostingSubscription(self):
person = self._makePerson() person = self._makePerson()
hosting_subscription = self._makeHostingSubscription() hosting_subscription = self._makeHostingSubscription()
hosting_subscription.edit( hosting_subscription.edit(
...@@ -501,6 +502,8 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -501,6 +502,8 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(slap_state, hosting_subscription.getSlapState()) self.assertEqual(slap_state, hosting_subscription.getSlapState())
self.assertEqual('stopped', upgrade_decision.getSimulationState()) self.assertEqual('stopped', upgrade_decision.getSimulationState())
@simulate('HostingSubscription_isUpgradePossible',
'software_release_url', 'return 1')
def testUpgradeDecision_processUpgradeeHostingSubscription(self): def testUpgradeDecision_processUpgradeeHostingSubscription(self):
person = self._makePerson() person = self._makePerson()
hosting_subscription = self._makeHostingSubscription() hosting_subscription = self._makeHostingSubscription()
......
test.erp5.testSlapOSPDMAlarm test.erp5.testSlapOSPDMAlarm
test.erp5.testSlapOSPDMSkins test.erp5.testSlapOSPDMSkins
test.erp5.testSlapOSPDMDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm test.erp5.testSlapOSPDMDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm
test.erp5.testSlapOSPDMUpgradeDecisionSkins test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins
\ No newline at end of file \ No newline at end of file
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