Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
slapos.core
Commits
8217636f
Commit
8217636f
authored
Mar 27, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover SoftwareRelease.destroyed call.
Cover different cases of having already setup packing list.
parent
de1f7214
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
448 additions
and
0 deletions
+448
-0
master/product/Vifib/tests/testVifibSlapSoftwareReleaseDestroyed.py
...duct/Vifib/tests/testVifibSlapSoftwareReleaseDestroyed.py
+392
-0
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+56
-0
No files found.
master/product/Vifib/tests/testVifibSlapSoftwareReleaseDestroyed.py
0 → 100644
View file @
8217636f
from
Products.ERP5Type.tests.Sequence
import
SequenceList
import
unittest
from
testVifibSlapWebService
import
TestVifibSlapWebServiceMixin
class
TestVifibSlapSoftwareReleaseDestroyed
(
TestVifibSlapWebServiceMixin
):
########################################
# SoftwareRelease.destroyed
########################################
def
test_SoftwareRelease_destroyed_afterRegister
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_formated_computer
+
'
\
SlapLoginCurrentComputer
\
SelectNewSoftwareReleaseUri
\
CheckNotFoundSoftwareReleaseDestroyedAfterRegisterCall
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_CleanupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_cleanup_purchase_packing_list
+
'
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingList
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_ConfirmedState_CleanupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
SetCurrentPurchasePackingListAsA
\
Logout '
+
\
self
.
prepare_software_release_cleanup_confirmed_packing_list
+
'
\
SetCurrentPurchasePackingListAsB
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_StartedState_CleanupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
SetCurrentPurchasePackingListAsA
\
Logout'
+
\
self
.
prepare_software_release_cleanup_confirmed_packing_list
+
'
\
SetCurrentPurchasePackingListAsB
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_StoppedState_CleanupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
StopPurchasePackingList
\
Tic
\
SetCurrentPurchasePackingListAsA
\
Logout'
+
\
self
.
prepare_software_release_cleanup_confirmed_packing_list
+
'
\
SetCurrentPurchasePackingListAsB
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_DeliveredState_CleanupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
StopPurchasePackingList
\
Tic
\
DeliverPurchasePackingList
\
Tic
\
SetCurrentPurchasePackingListAsA
\
Logout'
+
\
self
.
prepare_software_release_cleanup_confirmed_packing_list
+
'
\
SetCurrentPurchasePackingListAsB
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_CancelledState_CleanupResource_ConfirmedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
CancelPurchasePackingList
\
Tic
\
SetCurrentPurchasePackingListAsA
\
Logout'
+
\
self
.
prepare_software_release_cleanup_confirmed_packing_list
+
'
\
SetCurrentPurchasePackingListAsB
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
LoginDefaultUser
\
CheckCancelledPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_CancelledState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
CancelPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckCancelledPurchasePackingList
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_CleanupResource_CancelledState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
CancelPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_available_CleanupResource_StartedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingList
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_StartedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_CleanupResource_StoppedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
StopPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckStoppedPurchasePackingList
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_StoppedState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
StopPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_CleanupResource_DeliveredState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
StopPurchasePackingList
\
DeliverPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingList
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_SetupResource_DeliveredState
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_software_release_purchase_packing_list
+
'
\
LoginDefaultUser
\
StartPurchasePackingList
\
Tic
\
StopPurchasePackingList
\
Tic
\
DeliverPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckNotFoundSoftwareReleaseAvailableCall
\
Tic
\
SlapLogout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_SoftwareRelease_destroyed_twoPurchasePackingList
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_two_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
StepPurchasePackingListBStartDateAfterPurchasePackingListA
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseDestroyedCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_string
=
self
.
prepare_two_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
StepPurchasePackingListBStartDateBeforePurchasePackingListA
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckSuccessSoftwareReleaseAvailableCall
\
Tic
\
SlapLogout
\
LoginDefaultUser
\
CheckDeliveredPurchasePackingListA
\
CheckDeliveredPurchasePackingListB
\
Logout
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestVifibSlapSoftwareReleaseDestroyed
))
return
suite
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
8217636f
...
...
@@ -1354,6 +1354,24 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
CheckConfirmedPurchasePackingListB
\
Logout'
prepare_two_cleanup_purchase_packing_list
=
\
prepare_software_release_cleanup_purchase_packing_list
+
'
\
LoginDefaultUser
\
SetCurrentPurchasePackingListAsA
\
StartPurchasePackingList
\
StopPurchasePackingList
\
Tic
\
Logout
\
SlapLoginCurrentComputer
\
CheckEmptyComputerGetSoftwareReleaseListCall
\
SlapLogout '
+
\
prepare_software_release_cleanup_confirmed_packing_list
+
'
\
LoginDefaultUser
\
SetCurrentPurchasePackingListAsB
\
CheckStoppedPurchasePackingListA
\
CheckConfirmedPurchasePackingListB
\
Logout'
prepare_another_computer_sequence_string
=
"""
StoreComputerReference
LoginTestVifibAdmin
...
...
@@ -2536,6 +2554,16 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
software_release
.
_computer_guid
=
computer_guid
self
.
assertRaises
(
slap
.
NotFoundError
,
software_release
.
available
)
def
stepCheckNotFoundSoftwareReleaseDestroyedCall
(
self
,
sequence
,
**
kw
):
computer_guid
=
sequence
[
"computer_reference"
]
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
,
timeout
=
None
)
software_release
=
self
.
slap
.
registerSoftwareRelease
(
sequence
[
'software_release_uri'
])
# Note: Hackish
software_release
.
_computer_guid
=
computer_guid
self
.
assertRaises
(
slap
.
NotFoundError
,
software_release
.
destroyed
)
def
stepCheckTicAndNotFoundSoftwareReleaseAvailableCall
(
self
,
sequence
,
**
kw
):
"""
Check that calling SoftwareRelease.available raises NotFound
...
...
@@ -2594,6 +2622,15 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self
.
assertRaises
(
slap
.
NotFoundError
,
software_release
.
error
,
"ErrorLog"
)
def
stepCheckNotFoundSoftwareReleaseDestroyedAfterRegisterCall
(
self
,
sequence
,
**
kw
):
url
=
sequence
[
"software_release_uri"
]
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
,
timeout
=
None
)
software_release
=
self
.
slap
.
registerSoftwareRelease
(
url
)
self
.
assertRaises
(
slap
.
NotFoundError
,
software_release
.
destroyed
)
def
stepCheckNotFoundSoftwareReleaseAvailableAfterRegisterCall
(
self
,
sequence
,
**
kw
):
"""
...
...
@@ -2619,6 +2656,15 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
software_release
.
available
()
def
stepCheckSuccessSoftwareReleaseDestroyedCall
(
self
,
sequence
,
**
kw
):
computer_guid
=
sequence
[
"computer_reference"
]
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
,
timeout
=
None
)
computer
=
self
.
slap
.
registerComputer
(
computer_guid
)
software_release
=
computer
.
getSoftwareReleaseList
()[
0
]
software_release
.
destroyed
()
def
stepCheckUnauthorizedSoftwareReleaseAvailableCall
(
self
,
sequence
,
**
kw
):
"""
Check that calling SoftwareRelease.available is Unauthorized
...
...
@@ -3757,6 +3803,16 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'purchase_packing_list_b_uid'
]).
getSimulationState
())
def
stepCheckDeliveredPurchasePackingListA
(
self
,
sequence
):
self
.
assertEqual
(
'delivered'
,
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'purchase_packing_list_a_uid'
]).
getSimulationState
())
def
stepCheckDeliveredPurchasePackingListB
(
self
,
sequence
):
self
.
assertEqual
(
'delivered'
,
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'purchase_packing_list_b_uid'
]).
getSimulationState
())
def
stepCheckSlaveInstanceSecurityWithDifferentCustomer
(
self
,
sequence
):
software_instance_uid
=
sequence
[
"software_instance_uid"
]
portal_membership
=
self
.
portal
.
portal_membership
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment