Commit 0ed82865 authored by Łukasz Nowak's avatar Łukasz Nowak

Prove that it is possible to reuse software instance title.

Additionaly update some assertions to support such case.
parent 46263eca
...@@ -1079,7 +1079,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1079,7 +1079,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list.play(self) sequence_list.play(self)
def stepSetRequestedStateStarted(self, sequence, **kw): def stepSetRequestedStateStarted(self, sequence, **kw):
sequence['state'] = 'started' sequence['requested_state'] = 'started'
def stepSetRequestedStateStopped(self, sequence, **kw):
sequence['requested_state'] = 'stopped'
def stepSetRequestedReferenceRandom(self, sequence, **kw): def stepSetRequestedReferenceRandom(self, sequence, **kw):
sequence['requested_reference'] = str(random.random()) sequence['requested_reference'] = str(random.random())
...@@ -1131,6 +1134,8 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1131,6 +1134,8 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \ sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + """ self.prepare_formated_computer + """
SetRequestedStateStopped
LoginTestVifibAdmin LoginTestVifibAdmin
RequestSoftwareInstallation RequestSoftwareInstallation
Tic Tic
...@@ -1157,6 +1162,49 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1157,6 +1162,49 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
Tic Tic
SlapLogout SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
SetSelectedComputerPartition
SetRequestedComputerPartition
CheckComputerPartitionNoInstanceHostingSalePackingList
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
Logout
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
Logout
SlapLoginCurrentComputer
SoftwareInstanceDestroyed
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListDelivered
CheckComputerPartitionIsFree
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance SetCurrentPersonSlapRequestedSoftwareInstance
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
...@@ -1169,8 +1217,6 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1169,8 +1217,6 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
raise NotImplementedError
def test_request_new_with_destroyed_reference_web_ui(self): def test_request_new_with_destroyed_reference_web_ui(self):
"""Prove that having destroyed SI allows to request new one with same """Prove that having destroyed SI allows to request new one with same
reference reference
......
...@@ -223,9 +223,18 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -223,9 +223,18 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
requested_slap_computer_partition.getId()) requested_slap_computer_partition.getId())
def stepSetCurrentPersonSlapRequestedSoftwareInstance(self, sequence, **kw): def stepSetCurrentPersonSlapRequestedSoftwareInstance(self, sequence, **kw):
software_instance_list = self.portal.portal_catalog( cleanup_resource = self.portal.portal_preferences\
.getPreferredInstanceCleanupResource()
software_instance_list = []
for software_instance in self.portal.portal_catalog(
portal_type=self.software_instance_portal_type, portal_type=self.software_instance_portal_type,
title=sequence['requested_reference']) title=sequence['requested_reference']):
# only not yet destroyed ones
try:
software_instance.Item_getInstancePackingListLine(cleanup_resource)
except ValueError:
software_instance_list.append(software_instance)
self.assertEqual(1, len(software_instance_list)) self.assertEqual(1, len(software_instance_list))
software_instance = software_instance_list[0] software_instance = software_instance_list[0]
sequence.edit( sequence.edit(
...@@ -3415,9 +3424,13 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -3415,9 +3424,13 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition = computer_partition_list[0] computer_partition = computer_partition_list[0]
# This Computer Partition shall have only Sale Packing List Line related # This Computer Partition shall have only Sale Packing List Line related
computer_partition_sale_packing_list_line_list = computer_partition\ computer_partition_sale_packing_list_line_list = []
for delivery_line in computer_partition\
.getAggregateRelatedValueList( .getAggregateRelatedValueList(
portal_type=self.sale_packing_list_line_portal_type) portal_type=self.sale_packing_list_line_portal_type):
if sequence['software_instance_uid'] in delivery_line\
.getAggregateUidList():
computer_partition_sale_packing_list_line_list.append(delivery_line)
self.assertEqual(1, len(computer_partition_sale_packing_list_line_list)) self.assertEqual(1, len(computer_partition_sale_packing_list_line_list))
# There should be only one Sale Order Line # There should be only one Sale Order Line
...@@ -3434,9 +3447,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -3434,9 +3447,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition = computer_partition_list[0] computer_partition = computer_partition_list[0]
# This Computer Partition shall have only Sale Order Line related # This Computer Partition shall have only Sale Order Line related
computer_partition_sale_order_line_list = computer_partition\ computer_partition_sale_order_line_list = []
for order_line in computer_partition\
.getAggregateRelatedValueList( .getAggregateRelatedValueList(
portal_type=self.sale_order_line_portal_type) portal_type=self.sale_order_line_portal_type):
if sequence['software_instance_uid'] in order_line.getAggregateUidList():
computer_partition_sale_order_line_list.append(order_line)
self.assertEqual(1, len(computer_partition_sale_order_line_list)) self.assertEqual(1, len(computer_partition_sale_order_line_list))
def stepCheckSoftwareInstanceAndRelatedComputerPartition(self, def stepCheckSoftwareInstanceAndRelatedComputerPartition(self,
......
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