Commit a1838c89 authored by Łukasz Nowak's avatar Łukasz Nowak

Increase HostingSubscription_assertPredecessor coverage.

parent e207397a
...@@ -83,6 +83,47 @@ class TestSlapOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm( ...@@ -83,6 +83,47 @@ class TestSlapOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm(
self.assertTrue(self.hosting_subscription.getTitle() in self.assertTrue(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList()) self.hosting_subscription.getPredecessorTitleList())
def test_HostingSubscription_assertPredecessor_stop_requested(self):
self.software_instance.rename(new_name=self.generateNewSoftwareTitle())
self.portal.portal_workflow._jumpToStateFor(self.hosting_subscription,
'stop_requested')
self.tic()
# check that no interaction has recreated the instance
self.assertFalse(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList())
self.hosting_subscription.HostingSubscription_assertPredecessor()
self.assertTrue(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList())
def test_HostingSubscription_assertPredecessor_destroy_requested(self):
self.software_instance.rename(new_name=self.generateNewSoftwareTitle())
self.portal.portal_workflow._jumpToStateFor(self.hosting_subscription,
'destroy_requested')
self.tic()
# check that no interaction has recreated the instance
self.assertFalse(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList())
self.hosting_subscription.HostingSubscription_assertPredecessor()
self.assertFalse(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList())
def test_HostingSubscription_assertPredecessor_invalidated(self):
self.software_instance.rename(new_name=self.generateNewSoftwareTitle())
self.hosting_subscription.invalidate()
self.tic()
# check that no interaction has recreated the instance
self.assertFalse(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList())
self.hosting_subscription.HostingSubscription_assertPredecessor()
self.assertFalse(self.hosting_subscription.getTitle() in
self.hosting_subscription.getPredecessorTitleList())
def _simulateHostingSubscription_assertPredecessor(self): def _simulateHostingSubscription_assertPredecessor(self):
script_name = 'HostingSubscription_assertPredecessor' script_name = 'HostingSubscription_assertPredecessor'
if script_name in self.portal.portal_skins.custom.objectIds(): if script_name in self.portal.portal_skins.custom.objectIds():
......
200 201
\ 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