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
d5534cf7
Commit
d5534cf7
authored
Jan 30, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: fix requestComputeNode tests
parent
1cd44196
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
...s/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
+19
-12
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
View file @
d5534cf7
...
...
@@ -616,6 +616,8 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
# Only admin can create computer node
self
.
addProjectProductionManagerAssignment
(
person_user
,
self
.
project
)
self
.
tic
()
# Login as new user
...
...
@@ -626,19 +628,24 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
def
beforeTearDown
(
self
):
pass
def
test_request_requiredParameter
(
self
):
def
test_request
ComputeNode
_requiredParameter
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
# compute_node_title is mandatory
self
.
assertRaises
(
TypeError
,
person
.
requestComputeNode
,
project_reference
=
self
.
project
.
getReference
())
# if provided does not raise
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
# project_reference is mandatory
self
.
assertRaises
(
TypeError
,
person
.
requestComputeNode
,
compute_node_title
=
compute_node_title
)
# if provided does not raise
person
.
requestComputeNode
(
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
def
test_request
(
self
):
def
test_request
ComputeNode_request
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
...
...
@@ -654,7 +661,7 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
assertNotEqual
(
None
,
compute_node_absolute_url
)
self
.
assertNotEqual
(
None
,
compute_node_reference
)
def
test_request_createdComputeNode
(
self
):
def
test_request
ComputeNode
_createdComputeNode
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
previous_id
=
self
.
getPortalObject
().
portal_ids
\
...
...
@@ -683,10 +690,10 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
assertEqual
(
compute_node_reference
,
compute_node
.
getReference
())
self
.
assertEqual
(
'COMP-%s'
%
(
previous_id
+
1
),
compute_node
.
getReference
())
self
.
assertEqual
(
'validated'
,
compute_node
.
getValidationState
())
self
.
assertEqual
(
None
,
compute_node
.
getAllocationScope
())
self
.
assertEqual
(
'
open
'
,
compute_node
.
getCapacityScope
())
self
.
assertEqual
(
'open'
,
compute_node
.
getAllocationScope
())
self
.
assertEqual
(
'
close
'
,
compute_node
.
getCapacityScope
())
def
test_request_notReindexedCompute
(
self
):
def
test_request
ComputeNode
_notReindexedCompute
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
...
...
@@ -697,7 +704,7 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
project_reference
=
self
.
project
.
getReference
(),
compute_node_title
=
compute_node_title
)
def
test_multiple_request_createdComputeNode
(
self
):
def
test_
requestComputeNode_
multiple_request_createdComputeNode
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
previous_id
=
self
.
getPortalObject
().
portal_ids
\
...
...
@@ -727,7 +734,7 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
assertEqual
(
compute_node_reference
,
compute_node
.
getReference
())
self
.
assertEqual
(
'COMP-%s'
%
(
previous_id
+
1
),
compute_node
.
getReference
())
self
.
assertEqual
(
'validated'
,
compute_node
.
getValidationState
())
self
.
assertEqual
(
'open
/personal
'
,
compute_node
.
getAllocationScope
())
self
.
assertEqual
(
'open'
,
compute_node
.
getAllocationScope
())
self
.
assertEqual
(
'close'
,
compute_node
.
getCapacityScope
())
self
.
tic
()
...
...
@@ -754,7 +761,7 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
assertEqual
(
compute_node_reference
,
compute_node
.
getReference
())
self
.
assertEqual
(
'COMP-%s'
%
(
previous_id
+
1
),
compute_node
.
getReference
())
self
.
assertEqual
(
'validated'
,
compute_node
.
getValidationState
())
self
.
assertEqual
(
'open
/personal
'
,
compute_node
.
getAllocationScope
())
self
.
assertEqual
(
'open'
,
compute_node
.
getAllocationScope
())
self
.
assertEqual
(
'close'
,
compute_node
.
getCapacityScope
())
# and now another one
...
...
@@ -782,10 +789,10 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
assertEqual
(
compute_node_reference2
,
compute_node2
.
getReference
())
self
.
assertEqual
(
'COMP-%s'
%
(
previous_id
+
2
),
compute_node2
.
getReference
())
self
.
assertEqual
(
'validated'
,
compute_node2
.
getValidationState
())
self
.
assertEqual
(
'open
/personal
'
,
compute_node2
.
getAllocationScope
())
self
.
assertEqual
(
'open'
,
compute_node2
.
getAllocationScope
())
self
.
assertEqual
(
'close'
,
compute_node2
.
getCapacityScope
())
def
test_request_duplicatedComputeNode
(
self
):
def
test_request
ComputeNode
_duplicatedComputeNode
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
compute_node_title
=
self
.
generateNewComputeNodeTitle
()
...
...
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