Commit 219cf237 authored by Antoine Catton's avatar Antoine Catton

Update test to match with the previous reverts.

parent f9c12aa3
...@@ -682,32 +682,26 @@ class TestVifibSlapBang(TestVifibSlapWebServiceMixin): ...@@ -682,32 +682,26 @@ class TestVifibSlapBang(TestVifibSlapWebServiceMixin):
sequence_list.play(self) sequence_list.play(self)
def stepCheckTreeLooksLikeRenameComplexTree(self, sequence, **kw): def stepCheckTreeLooksLikeRenameComplexTree(self, sequence, **kw):
computer_guid = sequence["computer_reference"]
hosting_subscription_uid = sequence['hosting_subscription_uid'] hosting_subscription_uid = sequence['hosting_subscription_uid']
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
computer = self.slap.registerComputer(computer_guid)
partition_to_process = [partition
for partition in computer.getComputerPartitionList()
if partition._need_modification]
self.failUnlessEqual(len(partition_to_process), 4)
hosting_subscription = self.portal.portal_catalog.getResultValue( hosting_subscription = self.portal.portal_catalog.getResultValue(
uid=hosting_subscription_uid uid=hosting_subscription_uid
) )
root_software_instance = hosting_subscription.portal_catalog.getResultValue( root_software_instance = hosting_subscription.portal_catalog.getResultValue(
title=hosting_subscription.getTitle(), portal_type="Software Instance") title=hosting_subscription.getTitle(), portal_type="Software Instance",
root_uid=hosting_subscription_uid)
self.failIfEqual(root_software_instance, None) self.failIfEqual(root_software_instance, None)
self.failUnlessEqual(len(root_software_instance.getPredecessorList()), 2) children_titles = set([si.getTitle()
for si in root_software_instance.getPredecessorValueList()])
self.failUnless(set(['children_a', 'children_b']) <= children_titles)
children_b = hosting_subscription.portal_catalog.getResultValue( children_b_child = hosting_subscription.portal_catalog.getResultValue(
title='children_b', title='children_b_child',
root_uid=hosting_subscription.getUid(), root_uid=hosting_subscription.getUid(),
) )
self.failUnlessEqual(len(children_b.getPredecessorList()), 1) self.failIfEqual(children_b_child, None)
def test_ComputerPartition_rename_root_and_bang(self): def test_ComputerPartition_rename_root_and_bang(self):
r""" r"""
...@@ -913,28 +907,32 @@ class TestVifibSlapBang(TestVifibSlapWebServiceMixin): ...@@ -913,28 +907,32 @@ class TestVifibSlapBang(TestVifibSlapWebServiceMixin):
/ \ / \
| HS: Master | | HS: Master |
\________________________________/ \________________________________/
_____/____ _________\______ ________________|_______________
/ \
| SI: Master |
\________________________________/
_____/_____ _________\______
/ \ / \ / \ / \
| SI: Master | | SI: Child B Dead | | SI: Child A | | SI: Child B Dead |
\___________/ \________________/ \___________/ \________________/
_____|_____ ______|______ ______|______
/ \ / \ / \
| SI: Child A | | SI: GrandChild | | SI: GrandChild |
\___________/ \______________/ \______________/
Bang the tree. We espect to have a new C replacing it, Bang the tree. We espect to have a new C replacing it,
as : _________________________________________________ as : _________________________________________________
/ \ / \
| HS: Master | | HS: Master |
\_________________________________________________/ \_________________________________________________/
_____________|______________ _______|________ _____________|___________________________________
/ \ / \ / \
| SI: Master | | SI: Child B Dead | | SI: Master |
\____________________________/ \________________/ \_________________________________________________/
_____/_____ _____\_____ _____/_____ _____\_____ _______|________
/ \ / \ / \ / \ / \
| SI: Child A | | SI: Child B | | SI: Child A | | SI: Child B | | SI: Child B Dead |
\___________/ \___________/ \___________/ \___________/ \________________/
______|______ ______|______
/ \ / \
| SI: GrandChild | | SI: GrandChild |
......
...@@ -3878,15 +3878,6 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -3878,15 +3878,6 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
) )
software_instance.rename(new_name='%sDead' % software_instance.getTitle()) software_instance.rename(new_name='%sDead' % software_instance.getTitle())
self.stepTic()
parent = software_instance.getPredecessorRelatedValue(
portal_type=["Hosting Subscription", "Software Instance",
"Slave Instance"]
)
self.assertEquals(hosting_subscription,
parent,
"Software Instance wasn't reattached to the hosting "
"subscription")
def stepCheckTreeHasARootSoftwareInstance(self, sequence, **kw): def stepCheckTreeHasARootSoftwareInstance(self, sequence, **kw):
hosting_subscription_uid = sequence['hosting_subscription_uid'] hosting_subscription_uid = sequence['hosting_subscription_uid']
......
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