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
Titouan Soulard
slapos.core
Commits
5cfc571e
Commit
5cfc571e
authored
Mar 27, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover registerSupply and Supply.supply
parent
8217636f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
20 deletions
+142
-20
master/product/Vifib/tests/testVifibSlapSupply.py
master/product/Vifib/tests/testVifibSlapSupply.py
+142
-0
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+0
-20
No files found.
master/product/Vifib/tests/testVifibSlapSupply.py
0 → 100644
View file @
5cfc571e
from
Products.ERP5Type.tests.Sequence
import
SequenceList
import
unittest
from
testVifibSlapWebService
import
TestVifibSlapWebServiceMixin
from
slapos
import
slap
from
slapos.slap.slap
import
Supply
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
class
TestVifibSlapSupply
(
TestVifibSlapWebServiceMixin
):
########################################
# slap.registerSupply
########################################
def
test_slap_registerSupply
(
self
):
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
,
timeout
=
None
)
supply
=
self
.
slap
.
registerSupply
()
self
.
assertTrue
(
isinstance
(
supply
,
Supply
))
########################################
# Supply.supply
########################################
def
stepSupplyComputerSoftwareReleaseAvailable
(
self
,
sequence
,
**
kw
):
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
,
timeout
=
None
)
supply
=
self
.
slap
.
registerSupply
()
supply
.
supply
(
sequence
[
'software_release_uri'
],
sequence
[
'computer_reference'
],
'available'
)
def
stepSupplyComputerSoftwareReleaseDestroyed
(
self
,
sequence
,
**
kw
):
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
,
timeout
=
None
)
supply
=
self
.
slap
.
registerSupply
()
supply
.
supply
(
sequence
[
'software_release_uri'
],
sequence
[
'computer_reference'
],
'destroyed'
)
def
test_Supply_supply
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_formated_computer
+
\
self
.
prepare_published_software_release
+
"""
SlapLoginCurrentComputer
CheckEmptyComputerGetSoftwareReleaseListCall
SlapLogout
SlapLoginTestVifibAdmin
SupplyComputerSoftwareReleaseAvailable
Tic
SlapLogout
SlapLoginCurrentComputer
CheckSuccessComputerGetSoftwareReleaseListCall
SlapLogout
SlapLoginTestVifibAdmin
SupplyComputerSoftwareReleaseDestroyed
Tic
SlapLogout
SlapLoginCurrentComputer
CheckDestroyedStateGetSoftwareReleaseListCall
SlapLogout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
_checkOnePurchasePackingList
(
self
,
sequence
,
resource_uid
):
self
.
assertEqual
(
1
,
self
.
portal
.
portal_catalog
.
countResults
(
portal_type
=
'Purchase Packing List Line'
,
simulation_state
=
'confirmed'
,
default_resource_uid
=
resource_uid
,
default_aggregate_uid
=
ComplexQuery
(
Query
(
default_aggregate_uid
=
sequence
[
'computer_uid'
]),
Query
(
default_aggregate_uid
=
sequence
[
'software_release_uid'
]),
operator
=
'AND'
)
)[
0
][
0
]
)
def
stepCheckOneConfirmedSetupPurchasePackingListLineComputerSoftwareRelease
(
self
,
sequence
,
**
kw
):
self
.
_checkOnePurchasePackingList
(
sequence
,
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredSoftwareSetupResource
()
).
getUid
())
def
stepCheckOneConfirmedCleanupPurchasePackingListLineComputerSoftwareRelease
(
self
,
sequence
,
**
kw
):
self
.
_checkOnePurchasePackingList
(
sequence
,
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredSoftwareCleanupResource
()
).
getUid
())
def
test_Supply_supply_twice
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_formated_computer
+
\
self
.
prepare_published_software_release
+
"""
SlapLoginCurrentComputer
CheckEmptyComputerGetSoftwareReleaseListCall
SlapLogout
SlapLoginTestVifibAdmin
SupplyComputerSoftwareReleaseAvailable
Tic
SupplyComputerSoftwareReleaseAvailable
Tic
SlapLogout
SlapLoginCurrentComputer
CheckSuccessComputerGetSoftwareReleaseListCall
SlapLogout
LoginDefaultUser
CheckOneConfirmedSetupPurchasePackingListLineComputerSoftwareRelease
Logout
SlapLoginTestVifibAdmin
SupplyComputerSoftwareReleaseDestroyed
Tic
SupplyComputerSoftwareReleaseDestroyed
Tic
SlapLogout
SlapLoginCurrentComputer
CheckDestroyedStateGetSoftwareReleaseListCall
SlapLogout
LoginDefaultUser
CheckOneConfirmedCleanupPurchasePackingListLineComputerSoftwareRelease
Logout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestVifibSlapSupply
))
return
suite
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
5cfc571e
...
...
@@ -4195,26 +4195,6 @@ class TestVifibSlapWebService(TestVifibSlapWebServiceMixin):
"""
raise
NotImplementedError
########################################
# slap.registerSupply
########################################
@
skip
(
'Not implemented'
)
def
test_slap_registerSupply
(
self
):
"""
"""
raise
NotImplementedError
########################################
# Supply.supply
########################################
@
skip
(
'Not implemented'
)
def
test_Supply_supply
(
self
):
"""
"""
raise
NotImplementedError
########################################
# ComputerPartition.getId
########################################
...
...
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