Commit 83048c9c authored by Łukasz Nowak's avatar Łukasz Nowak

Test Software Release Cleanup resource basic functionality.

parent 1dcd2438
......@@ -221,6 +221,125 @@ class TestVifibSlapComputerGetSoftwareReleaseList(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_CleanupResource_ConfirmedState(self):
"""
Check that calling Computer.getSoftwareReleaseList works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + \
self.prepare_software_release_cleanup_confirmed_packing_list + '\
SlapLoginCurrentComputer \
CheckSuccessComputerGetSoftwareReleaseListCall \
CheckDestroyedStateGetSoftwareReleaseListCall \
SlapLogout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_CleanupResource_StartedState(self):
"""
Check that calling Computer.getSoftwareReleaseList works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + \
self.prepare_software_release_cleanup_confirmed_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessComputerGetSoftwareReleaseListCall \
CheckDestroyedStateGetSoftwareReleaseListCall \
SlapLogout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_CleanupResource_StoppedState(self):
"""
Check that calling Computer.getSoftwareReleaseList works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + \
self.prepare_software_release_cleanup_confirmed_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
Tic \
StopPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckEmptyComputerGetSoftwareReleaseListCall \
SlapLogout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_CleanupResource_DeliveredState(self):
"""
Check that calling Computer.getSoftwareReleaseList works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + \
self.prepare_software_release_cleanup_confirmed_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
Tic \
StopPurchasePackingList \
Tic \
DeliverPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckEmptyComputerGetSoftwareReleaseListCall \
SlapLogout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_CleanupResource_CancelledState(self):
"""
Check that calling Computer.getSoftwareReleaseList works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + \
self.prepare_software_release_cleanup_confirmed_packing_list + '\
LoginDefaultUser \
CancelPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckEmptyComputerGetSoftwareReleaseListCall \
SlapLogout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getSoftwareReleaseList_AccountingResource_ConfirmedState(self):
"""
Check that calling Computer.getSoftwareReleaseList works in
......
......@@ -998,6 +998,20 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
Logout
"""
prepare_software_release_cleanup_confirmed_packing_list = """
LoginDefaultUser
CreatePurchasePackingList
Tic
CreatePurchasePackingListLine
Tic
SetPurchasePackingListLineCleanupResource
SetPurchasePackingListLineAggregate
ConfirmPurchasePackingList
Tic
CheckConfirmedPurchasePackingList
Logout
"""
prepare_software_release_purchase_packing_list = \
prepare_published_software_release + prepare_formated_computer + \
prepare_software_release_confirmed_packing_list
......@@ -2328,6 +2342,19 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer = self.slap.registerComputer(computer_guid)
self.assertEquals([], computer.getSoftwareReleaseList())
def stepCheckDestroyedStateGetSoftwareReleaseListCall(self, sequence, **kw):
"""
Check that Computer.getSoftwareReleaseList returns software release
associated to the computer.
"""
computer_guid = sequence["computer_reference"]
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
computer = self.slap.registerComputer(computer_guid)
self.assertEquals(1, len(computer.getSoftwareReleaseList()))
software_release = computer.getSoftwareReleaseList()[0]
self.assertEqual('destroyed', software_release.getState())
def stepCheckSuccessComputerGetSoftwareReleaseListCall(self, sequence, **kw):
"""
Check that Computer.getSoftwareReleaseList returns software release
......@@ -3493,6 +3520,17 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
resource=self.portal.portal_preferences.\
getPreferredSoftwareSetupResource())
def stepSetPurchasePackingListLineCleanupResource(self, sequence, **kw):
"""
Associate the setup service to the purchase packing list line.
"""
line = self.portal.portal_catalog.getResultValue(
uid=sequence["purchase_packing_list_line_uid"])
line.edit(
quantity=1,
resource=self.portal.portal_preferences.\
getPreferredSoftwareCleanupResource())
def stepSetAccountingBeforeSetupStartDate(self, sequence, **kw):
"""
Set date on Purchase Packing List Line
......
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