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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
71fd8792
Commit
71fd8792
authored
Jan 06, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: project needed
parent
27147751
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
142 deletions
+73
-142
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
...s/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
+73
-142
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
View file @
71fd8792
...
@@ -29,7 +29,8 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -29,7 +29,8 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
...
@@ -65,6 +66,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -65,6 +66,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# software_title is mandatory
# software_title is mandatory
...
@@ -75,6 +77,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -75,6 +77,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# software_type is mandatory
# software_type is mandatory
...
@@ -85,6 +88,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -85,6 +88,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# instance_xml is mandatory
# instance_xml is mandatory
...
@@ -95,6 +99,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -95,6 +99,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# instance_xml is mandatory
# instance_xml is mandatory
...
@@ -105,6 +110,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -105,6 +110,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# sla_xml is mandatory
# sla_xml is mandatory
...
@@ -115,6 +121,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -115,6 +121,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
instance_xml
=
instance_xml
,
instance_xml
=
instance_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# shared is mandatory
# shared is mandatory
...
@@ -125,6 +132,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -125,6 +132,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
instance_xml
=
instance_xml
,
instance_xml
=
instance_xml
,
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
# state is mandatory
# state is mandatory
...
@@ -135,6 +143,17 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -135,6 +143,17 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
instance_xml
=
instance_xml
,
instance_xml
=
instance_xml
,
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
project_reference
=
self
.
project
.
getReference
()
)
# project_reference is mandatory
self
.
assertRaises
(
TypeError
,
person
.
requestSoftwareInstance
,
software_release
=
software_release
,
software_title
=
software_title
,
software_type
=
software_type
,
instance_xml
=
instance_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
)
)
def
test_Person_requestSoftwareInstance_acceptedState
(
self
):
def
test_Person_requestSoftwareInstance_acceptedState
(
self
):
...
@@ -159,6 +178,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -159,6 +178,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"foo"
,
state
=
"foo"
,
project_reference
=
self
.
project
.
getReference
()
)
)
person
.
requestSoftwareInstance
(
person
.
requestSoftwareInstance
(
...
@@ -169,6 +189,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -169,6 +189,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"started"
,
state
=
"started"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
"start_requested"
,
instance_tree
.
getSlapState
())
self
.
assertEqual
(
"start_requested"
,
instance_tree
.
getSlapState
())
...
@@ -181,6 +202,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -181,6 +202,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"stopped"
,
state
=
"stopped"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
"stop_requested"
,
instance_tree
.
getSlapState
())
self
.
assertEqual
(
"stop_requested"
,
instance_tree
.
getSlapState
())
...
@@ -193,6 +215,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -193,6 +215,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"destroyed"
,
state
=
"destroyed"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
None
,
instance_tree
)
self
.
assertEqual
(
None
,
instance_tree
)
...
@@ -219,6 +242,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -219,6 +242,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
"Instance Tree"
,
self
.
assertEqual
(
"Instance Tree"
,
...
@@ -250,6 +274,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -250,6 +274,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
software_release
,
self
.
assertEqual
(
software_release
,
...
@@ -286,6 +311,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -286,6 +311,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
transaction
.
commit
()
transaction
.
commit
()
...
@@ -297,6 +323,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -297,6 +323,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
@
expectedFailure
@
expectedFailure
...
@@ -322,6 +349,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -322,6 +349,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree_reference
=
instance_tree
.
getReference
()
instance_tree_reference
=
instance_tree
.
getReference
()
...
@@ -350,6 +378,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -350,6 +378,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml2
,
sla_xml
=
sla_xml2
,
shared
=
shared2
,
shared
=
shared2
,
state
=
state2
,
state
=
state2
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
...
@@ -390,6 +419,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -390,6 +419,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
transaction
.
commit
()
transaction
.
commit
()
...
@@ -408,6 +438,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -408,6 +438,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
def
test_Person_requestSoftwareInstance_InstanceTreeNewTitle
(
self
):
def
test_Person_requestSoftwareInstance_InstanceTreeNewTitle
(
self
):
...
@@ -433,6 +464,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -433,6 +464,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
state
,
state
=
state
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
...
@@ -460,6 +492,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -460,6 +492,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml2
,
sla_xml
=
sla_xml2
,
shared
=
shared2
,
shared
=
shared2
,
state
=
state2
,
state
=
state2
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
...
@@ -499,6 +532,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -499,6 +532,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"stopped"
,
state
=
"stopped"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
transaction
.
commit
()
transaction
.
commit
()
...
@@ -512,6 +546,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -512,6 +546,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"destroyed"
,
state
=
"destroyed"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
None
,
instance_tree2
)
self
.
assertEqual
(
None
,
instance_tree2
)
...
@@ -538,6 +573,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -538,6 +573,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"stopped"
,
state
=
"stopped"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
transaction
.
commit
()
transaction
.
commit
()
...
@@ -550,6 +586,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -550,6 +586,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"destroyed"
,
state
=
"destroyed"
,
project_reference
=
self
.
project
.
getReference
()
)
)
self
.
assertEqual
(
"destroy_requested"
,
instance_tree
.
getSlapState
())
self
.
assertEqual
(
"destroy_requested"
,
instance_tree
.
getSlapState
())
transaction
.
commit
()
transaction
.
commit
()
...
@@ -563,6 +600,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -563,6 +600,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
sla_xml
=
sla_xml
,
sla_xml
=
sla_xml
,
shared
=
shared
,
shared
=
shared
,
state
=
"started"
,
state
=
"started"
,
project_reference
=
self
.
project
.
getReference
()
)
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
instance_tree2
=
person
.
REQUEST
.
get
(
'request_instance_tree'
)
self
.
assertEqual
(
"start_requested"
,
instance_tree2
.
getSlapState
())
self
.
assertEqual
(
"start_requested"
,
instance_tree2
.
getSlapState
())
...
@@ -576,7 +614,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -576,7 +614,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
...
@@ -591,17 +630,20 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -591,17 +630,20 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
# compute_node_title is mandatory
# compute_node_title is mandatory
self
.
assertRaises
(
TypeError
,
person
.
requestComputeNode
)
self
.
assertRaises
(
TypeError
,
person
.
requestComputeNode
,
project_reference
=
self
.
project
.
getReference
())
# if provided does not raise
# if provided does not raise
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
def
test_request
(
self
):
def
test_request
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
# check what is returned via request
# check what is returned via request
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
...
@@ -620,7 +662,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -620,7 +662,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
id_generator
=
'uid'
)
id_generator
=
'uid'
)
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
# check what is returned via request
# check what is returned via request
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
...
@@ -647,9 +690,11 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -647,9 +690,11 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
transaction
.
commit
()
transaction
.
commit
()
self
.
assertRaises
(
NotImplementedError
,
person
.
requestComputeNode
,
self
.
assertRaises
(
NotImplementedError
,
person
.
requestComputeNode
,
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
compute_node_title
=
compute_node_title
)
def
test_multiple_request_createdComputeNode
(
self
):
def
test_multiple_request_createdComputeNode
(
self
):
...
@@ -661,7 +706,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -661,7 +706,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title2
=
self
.
generateNewComputeNodeTitle
()
compute_node_title2
=
self
.
generateNewComputeNodeTitle
()
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
# check what is returned via request
# check what is returned via request
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
...
@@ -687,7 +733,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -687,7 +733,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
tic
()
self
.
tic
()
# request again the same compute_node
# request again the same compute_node
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
# check what is returned via request
# check what is returned via request
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
...
@@ -711,7 +758,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -711,7 +758,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
assertEqual
(
'close'
,
compute_node
.
getCapacityScope
())
self
.
assertEqual
(
'close'
,
compute_node
.
getCapacityScope
())
# and now another one
# and now another one
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title2
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title2
)
# check what is returned via request
# check what is returned via request
compute_node_url2
=
person
.
REQUEST
.
get
(
'compute_node'
)
compute_node_url2
=
person
.
REQUEST
.
get
(
'compute_node'
)
...
@@ -741,7 +789,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -741,7 +789,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
person
.
requestComputeNode
(
compute_node_title
=
compute_node_title
)
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
# check what is returned via request
# check what is returned via request
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
compute_node_url
=
person
.
REQUEST
.
get
(
'compute_node'
)
...
@@ -765,6 +814,7 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -765,6 +814,7 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
tic
()
self
.
tic
()
self
.
assertRaises
(
NotImplementedError
,
person
.
requestComputeNode
,
self
.
assertRaises
(
NotImplementedError
,
person
.
requestComputeNode
,
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
compute_node_title
=
compute_node_title
)
...
@@ -775,7 +825,8 @@ class TestSlapOSCorePersonRequestProject(SlapOSTestCaseMixin):
...
@@ -775,7 +825,8 @@ class TestSlapOSCorePersonRequestProject(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
...
@@ -867,130 +918,6 @@ class TestSlapOSCorePersonRequestProject(SlapOSTestCaseMixin):
...
@@ -867,130 +918,6 @@ class TestSlapOSCorePersonRequestProject(SlapOSTestCaseMixin):
class
TestSlapOSCorePersonRequestOrganisation
(
SlapOSTestCaseMixin
):
def
generateNewOrganisationTitle
(
self
):
return
'My Organisation %s'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestOrganisation_title_is_mandatoty
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestOrganisation
)
def
test_Person_requestOrganisation
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"client"
)
self
.
assertIn
(
"O-"
,
organisation
.
getReference
())
def
test_Person_requestOrganisation_duplicated
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"client"
)
self
.
assertIn
(
"O-"
,
organisation
.
getReference
())
organisation2
=
organisation
.
Base_createCloneDocument
(
batch_mode
=
1
)
organisation2
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertRaises
(
NotImplementedError
,
person
.
requestOrganisation
,
organisation_title
=
organisation_title
)
def
test_Person_requestOrganisation_request_again
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
self
.
tic
()
self
.
login
()
# check what is returned via request
person
.
REQUEST
.
set
(
'organisation_relative_url'
,
None
)
self
.
login
(
person
.
getUserId
())
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
# check what is returned via request
same_organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertEqual
(
same_organisation_relative_url
,
organisation_relative_url
)
def
test_Person_requestOrganisation_dont_conflict_with_site
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"client"
)
self
.
assertIn
(
"O-"
,
organisation
.
getReference
())
organisation2
=
organisation
.
Base_createCloneDocument
(
batch_mode
=
1
)
organisation2
.
edit
(
role
=
"host"
)
organisation2
.
validate
()
person
.
REQUEST
.
set
(
'organisation_relative_url'
,
None
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
same_organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertEqual
(
same_organisation_relative_url
,
organisation_relative_url
)
class
TestSlapOSCorePersonRequestSite
(
SlapOSTestCaseMixin
):
class
TestSlapOSCorePersonRequestSite
(
SlapOSTestCaseMixin
):
...
@@ -999,7 +926,8 @@ class TestSlapOSCorePersonRequestSite(SlapOSTestCaseMixin):
...
@@ -999,7 +926,8 @@ class TestSlapOSCorePersonRequestSite(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
...
@@ -1124,7 +1052,8 @@ class TestSlapOSCorePersonRequestNetwork(SlapOSTestCaseMixin):
...
@@ -1124,7 +1052,8 @@ class TestSlapOSCorePersonRequestNetwork(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
...
@@ -1218,7 +1147,8 @@ class TestSlapOSCorePersonRequestToken(SlapOSTestCaseMixin):
...
@@ -1218,7 +1147,8 @@ class TestSlapOSCorePersonRequestToken(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
# Login as new user
# Login as new user
...
@@ -1260,7 +1190,8 @@ class TestSlapOSCorePersonNotify(SlapOSTestCaseMixin):
...
@@ -1260,7 +1190,8 @@ class TestSlapOSCorePersonNotify(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
self
.
person
=
self
.
makePerson
()
self
.
project
=
self
.
addProject
()
self
.
person
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
self
.
tic
()
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
...
@@ -1276,7 +1207,7 @@ class TestSlapOSCorePersonNotify(SlapOSTestCaseMixin):
...
@@ -1276,7 +1207,7 @@ class TestSlapOSCorePersonNotify(SlapOSTestCaseMixin):
support_request_title
=
"a"
,
support_request_description
=
"b"
,
aggregate
=
"c"
)
support_request_title
=
"a"
,
support_request_description
=
"b"
,
aggregate
=
"c"
)
def
test_Person_notify_computer_node
(
self
):
def
test_Person_notify_computer_node
(
self
):
compute_node
,
_
=
self
.
_makeComputeNode
()
compute_node
,
_
=
self
.
_makeComputeNode
(
self
.
project
)
self
.
_test_Person_notify
(
compute_node
)
self
.
_test_Person_notify
(
compute_node
)
def
test_Person_notify_instance_tree
(
self
):
def
test_Person_notify_instance_tree
(
self
):
...
@@ -1295,7 +1226,7 @@ class TestSlapOSCorePersonNotify(SlapOSTestCaseMixin):
...
@@ -1295,7 +1226,7 @@ class TestSlapOSCorePersonNotify(SlapOSTestCaseMixin):
self
.
_test_Person_notify
(
instance_tree
)
self
.
_test_Person_notify
(
instance_tree
)
def
test_Person_notify_software_installation
(
self
):
def
test_Person_notify_software_installation
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
project
)
software_installation
=
self
.
portal
\
software_installation
=
self
.
portal
\
.
software_installation_module
.
template_software_installation
\
.
software_installation_module
.
template_software_installation
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
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