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
90cf05e3
Commit
90cf05e3
authored
Oct 03, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: test slapos_subscription_request_validate_submitted
parent
4e50419f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
...ortal_components/test.erp5.testSlapOSSubscriptionAlarm.py
+40
-2
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
View file @
90cf05e3
...
...
@@ -23,7 +23,11 @@ from erp5.component.test.SlapOSTestCaseMixin import \
class
TestSlapOSSubscriptionRequestProcessAlarm
(
SlapOSTestCaseMixin
):
#################################################################
# slapos_subscription_request_create_from_orphaned_item
#################################################################
def
_test_alarm_slapos_subscription_request_create_from_orphaned_item
(
self
,
portal_type
):
self
.
portal
.
testromain
()
script_name
=
"Item_createSubscriptionRequest"
alarm
=
self
.
portal
.
portal_alarms
.
slapos_subscription_request_create_from_orphaned_item
...
...
@@ -63,8 +67,42 @@ class TestSlapOSSubscriptionRequestProcessAlarm(SlapOSTestCaseMixin):
)
self
.
_test_alarm
(
alarm
,
document
,
script_name
)
def
test_
alarm_slapos_subscription_request_create_from_orphaned_instance_t
ree
(
self
):
def
test_
Item_createSubscriptionRequest_alarm_fromOrphanedInstanceT
ree
(
self
):
self
.
_test_alarm_slapos_subscription_request_create_from_orphaned_item
(
"Instance Tree"
)
def
test_
alarm_slapos_subscription_request_create_from_orphaned_compute_n
ode
(
self
):
def
test_
Item_createSubscriptionRequest_alarm_fromOrphanedComputeN
ode
(
self
):
self
.
_test_alarm_slapos_subscription_request_create_from_orphaned_item
(
"Compute Node"
)
def
test_Item_createSubscriptionRequest_alarm_fromOrphanedProject
(
self
):
portal_type
=
'Project'
script_name
=
"Item_createSubscriptionRequest"
alarm
=
self
.
portal
.
portal_alarms
.
slapos_subscription_request_create_from_orphaned_item
document
=
self
.
portal
.
getDefaultModule
(
portal_type
).
newContent
(
portal_type
=
portal_type
,
title
=
"Test %s no subscription %s"
%
(
portal_type
,
self
.
new_id
)
)
self
.
_test_alarm_not_visited
(
alarm
,
document
,
script_name
)
class
TestSlapOSSubscriptionRequestValidateAlarm
(
SlapOSTestCaseMixin
):
#################################################################
# slapos_subscription_request_validate_submitted
#################################################################
def
_createSubscriptionRequest
(
self
):
return
self
.
portal
.
subscription_request_module
.
newContent
(
portal_type
=
'Subscription Request'
,
title
=
"Test subscription %s"
%
(
self
.
generateNewId
())
)
def
test_SubscriptionRequest_validateIfSubmitted_alarm_notSubmitted
(
self
):
script_name
=
"SubscriptionRequest_validateIfSubmitted"
alarm
=
self
.
portal
.
portal_alarms
.
slapos_subscription_request_validate_submitted
self
.
_test_alarm_not_visited
(
alarm
,
self
.
_createSubscriptionRequest
(),
script_name
)
def
test_SubscriptionRequest_validateIfSubmitted_alarm_submitted
(
self
):
self
.
portal
.
testromain
()
script_name
=
"SubscriptionRequest_validateIfSubmitted"
alarm
=
self
.
portal
.
portal_alarms
.
slapos_subscription_request_validate_submitted
subscription_request
=
self
.
_createSubscriptionRequest
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
subscription_request
,
'submitted'
)
self
.
_test_alarm
(
alarm
,
subscription_request
,
script_name
)
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