Commit 28575f7b authored by Łukasz Nowak's avatar Łukasz Nowak

Check that locking works.

Assert that when cleanup was requested, cleanup nor installation cannot be
requested.
Assert that when installation was requested, cleanup nor installation cannot be
requested.
parent ddde6a04
...@@ -27,6 +27,15 @@ class TestVifibSlapSupply(TestVifibSlapWebServiceMixin): ...@@ -27,6 +27,15 @@ class TestVifibSlapSupply(TestVifibSlapWebServiceMixin):
supply.supply(sequence['software_release_uri'], supply.supply(sequence['software_release_uri'],
sequence['computer_reference'], 'available') sequence['computer_reference'], 'available')
def stepSupplyComputerSoftwareReleaseAvailableRaisesNotImplementedError(self,
sequence, **kw):
# slap not used to raise on server side
computer = self.portal.portal_catalog.getResultValue(
uid=sequence['computer_uid'])
self.assertRaises(NotImplementedError,
computer.requestSoftwareReleaseInstallation,
software_release_url=sequence['software_release_uri'])
def stepSupplyComputerSoftwareReleaseDestroyed(self, sequence, **kw): def stepSupplyComputerSoftwareReleaseDestroyed(self, sequence, **kw):
self.slap = slap.slap() self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None) self.slap.initializeConnection(self.server_url, timeout=None)
...@@ -34,6 +43,15 @@ class TestVifibSlapSupply(TestVifibSlapWebServiceMixin): ...@@ -34,6 +43,15 @@ class TestVifibSlapSupply(TestVifibSlapWebServiceMixin):
supply.supply(sequence['software_release_uri'], supply.supply(sequence['software_release_uri'],
sequence['computer_reference'], 'destroyed') sequence['computer_reference'], 'destroyed')
def stepSupplyComputerSoftwareReleaseDestroyedRaisesNotImplementedError(self,
sequence, **kw):
# slap not used to raise on server side
computer = self.portal.portal_catalog.getResultValue(
uid=sequence['computer_uid'])
self.assertRaises(NotImplementedError,
computer.requestSoftwareReleaseCleanup,
software_release_url=sequence['software_release_uri'])
def test_Supply_supply(self): def test_Supply_supply(self):
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + \ sequence_string = self.prepare_formated_computer + \
...@@ -136,6 +154,53 @@ class TestVifibSlapSupply(TestVifibSlapWebServiceMixin): ...@@ -136,6 +154,53 @@ class TestVifibSlapSupply(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_Supply_lock(self):
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + \
self.prepare_published_software_release + """
SlapLoginCurrentComputer
CheckEmptyComputerGetSoftwareReleaseListCall
SlapLogout
SlapLoginTestVifibAdmin
LoginTestVifibAdmin
SupplyComputerSoftwareReleaseAvailable
SupplyComputerSoftwareReleaseAvailableRaisesNotImplementedError
SupplyComputerSoftwareReleaseDestroyedRaisesNotImplementedError
Tic
SlapLogout
SlapLoginCurrentComputer
CheckSuccessComputerGetSoftwareReleaseListCall
SlapLogout
LoginDefaultUser
CheckOneConfirmedSetupPurchasePackingListLineComputerSoftwareRelease
Logout
SlapLoginTestVifibAdmin
LoginTestVifibAdmin
SupplyComputerSoftwareReleaseDestroyed
SupplyComputerSoftwareReleaseDestroyedRaisesNotImplementedError
SupplyComputerSoftwareReleaseAvailableRaisesNotImplementedError
Tic
SlapLogout
SlapLoginCurrentComputer
CheckDestroyedStateGetSoftwareReleaseListCall
SlapLogout
LoginDefaultUser
CheckOneConfirmedCleanupPurchasePackingListLineComputerSoftwareRelease
Logout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapSupply)) suite.addTest(unittest.makeSuite(TestVifibSlapSupply))
......
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