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

Avoid code duplication.

parent 181c2d07
......@@ -1776,13 +1776,13 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
def stepSetSoftwareInstanceChildrenA(self, sequence, **kw):
def _stepSetSoftwareInstanceChildren(self, sequence, source_reference):
software_instance_uid = sequence['root_software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
children_software_instance = \
software_instance.portal_catalog.getResultValue(
portal_type="Software Instance", source_reference='children_a',
portal_type="Software Instance", source_reference=source_reference,
root_uid=software_instance_uid)
self.assertNotEqual(None, children_software_instance)
self.assertNotEqual(software_instance.getRelativeUrl(),
......@@ -1794,31 +1794,17 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
_softwareInstance_getComputerPartition(children_software_instance
).getReference()
)
def stepSetSoftwareInstanceChildrenA(self, sequence, **kw):
self._stepSetSoftwareInstanceChildren(sequence, 'children_a')
def stepSetSoftwareInstanceChildrenB(self, sequence, **kw):
self._stepSetSoftwareInstanceChildren(sequence, 'children_b')
def stepSetRootSoftwareInstanceCurrentInstance(self, sequence, **kw):
software_instance_uid = sequence['software_instance_uid']
self.assertNotEqual(None, software_instance_uid)
sequence.edit(root_software_instance_uid=software_instance_uid)
def stepSetSoftwareInstanceChildrenB(self, sequence, **kw):
software_instance_uid = sequence['root_software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
children_software_instance = \
software_instance.portal_catalog.getResultValue(
portal_type="Software Instance", source_reference='children_b',
root_uid=software_instance_uid)
self.assertNotEqual(None, children_software_instance)
self.assertNotEqual(software_instance.getRelativeUrl(),
children_software_instance.getRelativeUrl())
sequence.edit(
software_instance_uid=children_software_instance.getUid(),
software_instance_reference=children_software_instance.getReference(),
computer_partition_reference=self.\
_softwareInstance_getComputerPartition(children_software_instance
).getReference()
)
def stepRequestComputerPartitionDifferentReferenceSameTransaction(self,
sequence, **kw):
software_release_uri = sequence['software_release_uri']
......
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