Commit ad2f613b authored by Romain Courteaud's avatar Romain Courteaud

Split testVifibSlapWebService.

It will reduce execution time.
parent 7d2851ca
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapComputerPartitionAvailable(TestVifibSlapWebServiceMixin):
########################################
# ComputerPartition.available
########################################
def test_ComputerPartition_available_afterRegister(self):
"""
Check that calling ComputerPartition.available after just registration raises a
NotFoundError
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + """
SlapLoginCurrentComputer
CheckNotFoundComputerPartitionAvailableAfterRegisterCall
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_available_successConfirmed(self):
"""
Check that calling ComputerPartition.available change the sale packing
list state to stopped.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_installed_computer_partition_sequence_string
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_available_alreadyStartedSalePackingList(self):
"""
Check that calling ComputerPartition.available more then once can be called
without error and changes nothing
"""
sequence_list = SequenceList()
sequence_string = \
self.prepare_installed_computer_partition_sequence_string + """
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListStopped
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionAvailable))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapComputerPartitionBuilding(TestVifibSlapWebServiceMixin):
########################################
# ComputerPartition.building
########################################
def test_ComputerPartition_building_afterRegister(self):
"""
Check that calling ComputerPartition.building after just registration raises a
NotFoundError
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckNotFoundComputerPartitionBuildingAfterRegisterCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_building_success(self):
"""
Check that calling ComputerPartition.building change the sale packing
list state to started.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_building_computer_partition_sequence_string
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_building_alreadyConfirmedSalePackingList(self):
"""
Check that calling ComputerPartition.building failed if there is already
confirmed sale packing list
"""
sequence_list = SequenceList()
sequence_string = self.prepare_building_computer_partition_sequence_string + """
SlapLoginCurrentComputer
SoftwareInstanceBuilding
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListStarted
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionBuilding))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapComputerPartitionConnection(TestVifibSlapWebServiceMixin):
########################################
# ComputerPartition.getConnectionParameter
# ComputerPartition.setConnectionDict
########################################
def test_ComputerPartition_Connection(self):
sequence_list = SequenceList()
sequence_string = """
LoginTestVifibDeveloper
SelectNewSoftwareReleaseUri
CreateSoftwareRelease
Tic
SubmitSoftwareRelease
Tic
CreateSoftwareProduct
Tic
ValidateSoftwareProduct
Tic
SetSoftwareProductToSoftwareRelease
PublishByActionSoftwareRelease
Logout
LoginTestVifibAdmin
CreateComputer
Tic
Logout
SlapLoginCurrentComputer
FormatComputer
Tic
SlapLogout
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
LoginTestVifibCustomer
PersonRequestSoftwareInstance
Tic
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
CheckGetSetConnectionDict
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionConnection))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapComputerPartitionGetInstanceParameterDict(TestVifibSlapWebServiceMixin):
########################################
# ComputerPartition.getInstanceParameterDict
########################################
def test_ComputerPartition_getInstanceParameterDict_afterRegister(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict after just
registration works
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SlapLoginCurrentComputer \
CheckSuccessComputerPartitionGetInstanceParameterDictCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getInstanceParameterDict_confirmedState(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict works in
confirmed state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SlapLoginCurrentSoftwareInstance \
CheckSuccessComputerPartitionGetInstanceParameterDictCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getInstanceParameterDict_cancelledState(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict works in
cancelled state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
LoginDefaultUser \
SelectCurrentlyUsedSalePackingListUid \
CancelSalePackingList \
Tic \
Logout \
SlapLoginCurrentSoftwareInstance \
CheckSuccessComputerPartitionGetInstanceParameterDictCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getInstanceParameterDict_startedState(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict works in
started state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_building_computer_partition_sequence_string + '\
SlapLoginCurrentSoftwareInstance \
CheckSuccessComputerPartitionGetInstanceParameterDictCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getInstanceParameterDict_stoppedState(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict works in
stopped state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_installed_computer_partition_sequence_string + '\
SlapLoginCurrentSoftwareInstance \
CheckSuccessComputerPartitionGetInstanceParameterDictCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getInstanceParameterDict_emptyParameter(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict does
return minimal information in case no parameters are set
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SlapLoginCurrentSoftwareInstance \
CheckMinimalParametersTransmitted \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getInstanceParameterDict_validXML(self):
"""
Check that calling ComputerPartition.getInstanceParameterDict works
if the XML doesn't respect the XSD
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
LoginDefaultUser \
SetSoftwareInstanceValidXML \
Tic \
Logout \
SlapLoginCurrentSoftwareInstance \
CheckComputerPartitionGetInstanceParameterDictResult \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionGetInstanceParameterDict))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapComputerPartitionGetSoftwareRelease(TestVifibSlapWebServiceMixin):
########################################
# ComputerPartition.getSoftwareRelease
########################################
def test_ComputerPartition_getSoftwareRelease_afterRegister(self):
"""
Check that calling ComputerPartition.getSoftwareRelease after just
registration raises a NotFoundError
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckNotFoundComputerPartitionGetSoftwareReleaseAfterRegisterCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getSoftwareRelease_confirmedState(self):
"""
Check that calling ComputerPartition.getSoftwareRelease works in
confirmed state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SlapLoginCurrentComputer \
CheckSuccessComputerPartitionGetSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getSoftwareRelease_cancelledState(self):
"""
Check that calling ComputerPartition.getSoftwareRelease works in
cancelled state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
LoginDefaultUser \
SelectCurrentlyUsedSalePackingListUid \
CancelSalePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessComputerPartitionGetSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getSoftwareRelease_startedState(self):
"""
Check that calling ComputerPartition.getSoftwareRelease works in
started state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_building_computer_partition_sequence_string + '\
SlapLoginCurrentComputer \
CheckSuccessComputerPartitionGetSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getSoftwareRelease_stoppedState(self):
"""
Check that calling ComputerPartition.getSoftwareRelease works in
stopped state
"""
sequence_list = SequenceList()
sequence_string = self.prepare_installed_computer_partition_sequence_string + '\
SlapLoginCurrentComputer \
CheckSuccessComputerPartitionGetSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_ComputerPartition_getSoftwareRelease_twoSalePackingList(self):
"""
Check that calling ComputerPartition.getSoftwareRelease """
sequence_list = SequenceList()
sequence_string = self.prepare_started_computer_partition_sequence_string + '\
LoginDefaultUser \
CheckPackingListAmountTwoComputerPartition \
SetHostingAfterSetupStartDate \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessComputerPartitionGetSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionGetSoftwareRelease))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapRegisterComputer(TestVifibSlapWebServiceMixin):
########################################
# slap.registerComputer
########################################
def test_slap_registerComputer_unknowComputerUid(self):
"""
Check the slap.registerComputer without any Computer document
does not fail
"""
sequence_list = SequenceList()
sequence_string = '\
SetRandomComputerReference \
LoginDefaultUser \
CheckSuccessSlapRegisterComputerCall \
Logout \
Tic \
LoginDefaultUser \
CheckUnexistingComputer \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputer_draftComputer(self):
"""
Check the slap.registerComputer does not fail if
a draft computer exits.
"""
sequence_list = SequenceList()
# Note: ERP5TypeTestCase is used as login to being able to test it
sequence_string = '\
LoginTestVifibAdmin \
CreateDraftComputer \
Tic \
Logout \
\
LoginDefaultUser \
CheckSuccessSlapRegisterComputerCall \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputer_validatedComputer(self):
"""
Check the slap.registerComputer does not fail if
a validated computer exists.
"""
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateComputer \
Tic \
Logout \
\
SlapLoginCurrentComputer\
CheckSuccessSlapRegisterComputerCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputer_TwoValidatedComputer(self):
"""
Check the slap.registerComputer works in case of more then one computer available
"""
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateComputer \
Tic \
Logout \
\
LoginTestVifibAdmin \
CreateComputer \
Tic \
Logout \
\
SlapLoginCurrentComputer\
CheckSuccessSlapRegisterComputerCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapRegisterComputer))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapRegisterComputerPartition(TestVifibSlapWebServiceMixin):
########################################
# slap.registerComputerPartition
########################################
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
@expectedFailure
def test_slap_registerComputerPartition_unknowComputerUid(self):
"""
Check the slap.registerComputerPartition without any Computer document
fails.
"""
sequence_list = SequenceList()
sequence_string = '\
SlapLoginRandomComputer \
CheckUnauthorizedSlapRegisterComputerPartitionCall \
SlapLogout \
Tic \
CheckUnexistingComputer \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
@expectedFailure
def test_slap_registerComputerPartition_draftComputer(self):
"""
Check the slap.registerComputerPartition fails
"""
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateDraftComputer \
Tic \
Logout \
\
SlapLoginCurrentComputer \
CheckUnauthorizedSlapRegisterComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputerPartition_ComputerWithoutPartition(self):
"""
Check the slap.registerComputerPartition fails
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
SlapLoginCurrentComputer\
CheckNotFoundSlapRegisterComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputerPartition_ComputerWithPartition(self):
"""
Check the slap.registerComputerPartition works
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputerPartition_TwoValidatedComputer(self):
"""
Check the slap.registerComputerPartition works
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerComputerPartition_ComputerWithTwoPartition(self):
"""
Check the slap.registerComputerPartition fails if there are 2 partition
with the same reference.
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapRegisterComputerPartition))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapRegisterSoftwareRelease(TestVifibSlapWebServiceMixin):
########################################
# slap.registerSoftwareRelease
########################################
def test_slap_registerSoftwareRelease_validatedSoftwareRelease(self):
"""
Check the slap.registerSoftwareRelease does not fail if
a validated computer exists.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
LoginTestVifibAdmin \
CreateComputer \
Tic \
Logout \
\
LoginTestVifibDeveloper \
SelectNewSoftwareReleaseUri \
CreateSoftwareRelease \
Tic \
SubmitSoftwareRelease \
Tic \
CreateSoftwareProduct \
Tic \
ValidateSoftwareProduct \
Tic \
SetSoftwareProductToSoftwareRelease \
PublishByActionSoftwareRelease \
Logout \
\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerSoftwareRelease_unknowSoftwareReleaseUid(self):
"""
Check the slap.registerSoftwareRelease without any SoftwareRelease document
does not fail
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
SelectNewSoftwareReleaseUri \
\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerSoftwareRelease_draftSoftwareRelease(self):
"""
Check the slap.registerSoftwareRelease does not fail if
a draft computer exits.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
LoginTestVifibDeveloper \
SelectNewSoftwareReleaseUri \
CreateSoftwareRelease \
Tic \
\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_slap_registerSoftwareRelease_TwoValidatedSoftwareRelease(self):
"""
Check the slap.registerSoftwareRelease works
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
LoginTestVifibDeveloper \
SelectNewSoftwareReleaseUri \
CreateSoftwareRelease \
Tic \
SubmitSoftwareRelease \
Tic \
CreateSoftwareProduct \
Tic \
ValidateSoftwareProduct \
Tic \
SetSoftwareProductToSoftwareRelease \
PublishByActionSoftwareRelease \
Logout \
\
LoginTestVifibDeveloper \
SelectNewSoftwareReleaseUri \
CreateSoftwareRelease \
Tic \
SubmitSoftwareRelease \
Tic \
CreateSoftwareProduct \
Tic \
ValidateSoftwareProduct \
Tic \
SetSoftwareProductToSoftwareRelease \
PublishByActionSoftwareRelease \
Logout \
\
SlapLoginCurrentComputer \
CheckSuccessSlapRegisterSoftwareReleaseCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapRegisterSoftwareRelease))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapSoftwareReleaseAvailable(TestVifibSlapWebServiceMixin):
########################################
# SoftwareRelease.available
########################################
def test_SoftwareRelease_available_afterRegister(self):
"""
Check that calling SoftwareRelease.available after just registration raises a
NotFoundError
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
SelectNewSoftwareReleaseUri \
CheckNotFoundSoftwareReleaseAvailableAfterRegisterCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_available_SetupResource_ConfirmedState(self):
"""
Check that calling SoftwareRelease.available works in
confirmed state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_available_SetupResource_CancelledState(self):
"""
Check that calling SoftwareRelease.available works in
cancelled state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
CancelPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckCancelledPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_available_SetupResource_StartedState(self):
"""
Check that calling SoftwareRelease.available works in
started state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_available_SetupResource_StoppedState(self):
"""
Check that calling SoftwareRelease.available works in
stopped state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
StopPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_available_SetupResource_DeliveredState(self):
"""
Check that calling SoftwareRelease.available works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
StopPurchasePackingList \
DeliverPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckDeliveredPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_available_twoPurchasePackingList(self):
"""
Check that calling SoftwareRelease.available uses the latest purchase packing
list for calculation
"""
sequence_list = SequenceList()
sequence_string = self.prepare_two_purchase_packing_list + '\
LoginDefaultUser \
StepPurchasePackingListBStartDateAfterPurchasePackingListA \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingListB \
Logout'
sequence_list.addSequenceString(sequence_string)
sequence_string = self.prepare_two_purchase_packing_list + '\
LoginDefaultUser \
StepPurchasePackingListBStartDateBeforePurchasePackingListA \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseAvailableCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingListB \
Logout'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapSoftwareReleaseAvailable))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapSoftwareReleaseBuilding(TestVifibSlapWebServiceMixin):
########################################
# SoftwareRelease.building
########################################
def test_SoftwareRelease_building_afterRegister(self):
"""
Check that calling SoftwareRelease.building after just registration raises a
NotFoundError
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SelectNewSoftwareReleaseUri \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseBuildingAfterRegisterCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_building_SetupResource_ConfirmedState(self):
"""
Check that calling SoftwareRelease.building works in
confirmed state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseBuildingCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStartedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_building_SetupResource_CancelledState(self):
"""
Check that calling SoftwareRelease.building works in
cancelled state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
CancelPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseBuildingCall \
SlapLogout \
LoginDefaultUser \
CheckCancelledPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_building_SetupResource_StartedState(self):
"""
Check that calling SoftwareRelease.building works in
started state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseBuildingCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStartedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_building_SetupResource_StoppedState(self):
"""
Check that calling SoftwareRelease.building works in
stopped state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
StopPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseBuildingCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStoppedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_building_SetupResource_DeliveredState(self):
"""
Check that calling SoftwareRelease.building works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
StopPurchasePackingList \
DeliverPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckNotFoundSoftwareReleaseBuildingCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckDeliveredPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_building_twoPurchasePackingList(self):
"""
Check that calling SoftwareRelease.building uses the Purchase Packing List
in proper state, regardless its date
"""
sequence_list = SequenceList()
sequence_string = self.prepare_two_purchase_packing_list + '\
LoginDefaultUser \
StepPurchasePackingListBStartDateAfterPurchasePackingListA \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseBuildingCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStartedPurchasePackingListB \
Logout'
sequence_list.addSequenceString(sequence_string)
sequence_string = self.prepare_two_purchase_packing_list + '\
LoginDefaultUser \
StepPurchasePackingListBStartDateBeforePurchasePackingListA \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseBuildingCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckStartedPurchasePackingListB \
Logout'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapSoftwareReleaseBuilding))
return suite
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
import urllib
import urlparse
import httplib
from xml_marshaller import xml_marshaller
import transaction
import unittest
class TestVifibSlapSoftwareReleaseError(TestVifibSlapWebServiceMixin):
########################################
# SoftwareRelease.error
########################################
def test_SoftwareRelease_error_afterRegister(self):
"""
Check that calling SoftwareRelease.error after just registration raises a
NotFoundError
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
SelectNewSoftwareReleaseUri \
CheckNotFoundSoftwareReleaseErrorAfterRegisterCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_error_SetupResource_ConfirmedState(self):
"""
Check that calling SoftwareRelease.error works in
confirmed state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListErrorText \
CheckConfirmedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_error_SetupResource_CancelledState(self):
"""
Check that calling SoftwareRelease.error works in
cancelled state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
CancelPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListNoErrorText \
CheckCancelledPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_error_SetupResource_StartedState(self):
"""
Check that calling SoftwareRelease.error works in
started state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListErrorText \
CheckStartedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_error_SetupResource_StoppedState(self):
"""
Check that calling SoftwareRelease.error works in
stopped state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
StopPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListNoErrorText \
CheckStoppedPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_error_SetupResource_DeliveredState(self):
"""
Check that calling SoftwareRelease.error works in
delivered state with the setup resource
"""
sequence_list = SequenceList()
sequence_string = self.prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
StartPurchasePackingList \
StopPurchasePackingList \
DeliverPurchasePackingList \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListNoErrorText \
CheckDeliveredPurchasePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SoftwareRelease_error_twoPurchasePackingList(self):
"""
Check that calling SoftwareRelease.error uses the latest purchase packing
list for calculation
"""
sequence_list = SequenceList()
sequence_string = self.prepare_two_purchase_packing_list + '\
SlapLoginCurrentComputer \
CheckSuccessComputerGetSoftwareReleaseListCall \
SlapLogout \
LoginDefaultUser \
StepPurchasePackingListBStartDateAfterPurchasePackingListA \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListErrorText \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_string = self.prepare_two_purchase_packing_list + '\
SlapLoginCurrentComputer \
CheckSuccessComputerGetSoftwareReleaseListCall \
SlapLogout \
LoginDefaultUser \
StepPurchasePackingListBStartDateBeforePurchasePackingListA \
Tic \
Logout \
SlapLoginCurrentComputer \
CheckSuccessSoftwareReleaseErrorCall \
Tic \
SlapLogout \
LoginDefaultUser \
CheckPurchasePackingListErrorText \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapSoftwareReleaseError))
return suite
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