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
e575bb75
Commit
e575bb75
authored
Nov 15, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test building alarm movement.
parent
3cf74711
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
2 deletions
+75
-2
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSTriggerBuildAlarm.py
...mplateItem/testSlapOSAccountingSlapOSTriggerBuildAlarm.py
+72
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
master/bt5/slapos_accounting/bt/template_test_id_list
master/bt5/slapos_accounting/bt/template_test_id_list
+2
-1
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSTriggerBuildAlarm.py
0 → 100644
View file @
e575bb75
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
##############################################################################
import
transaction
import
functools
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
def
simulateSimulationMovement_buildSlapOS
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
script_name
=
'SimulationMovement_buildSlapOS'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kwargs'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
if context.getTitle() == 'Not visited by SimulationMovement_buildSlapOS':
context.setTitle('Visited by SimulationMovement_buildSlapOS')
"""
)
transaction
.
commit
()
try
:
func
(
self
,
*
args
,
**
kwargs
)
finally
:
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
return
wrapped
class
TestAlarm
(
testSlapOSMixin
):
@
simulateSimulationMovement_buildSlapOS
def
test_SimulationMovement_withoutDelivery
(
self
):
applied_rule
=
self
.
portal
.
portal_simulation
.
newContent
(
portal_type
=
'Applied Rule'
)
simulation_movement
=
applied_rule
.
newContent
(
portal_type
=
'Simulation Movement'
,
title
=
'Not visited by SimulationMovement_buildSlapOS'
)
self
.
tic
()
self
.
portal
.
portal_alarms
.
slapos_trigger_build
.
activeSense
()
self
.
tic
()
self
.
assertEqual
(
'Visited by SimulationMovement_buildSlapOS'
,
simulation_movement
.
getTitle
())
@
simulateSimulationMovement_buildSlapOS
def
test_SimulationMovement_withDelivery
(
self
):
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
delivery_line
=
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
)
applied_rule
=
self
.
portal
.
portal_simulation
.
newContent
(
portal_type
=
'Applied Rule'
)
simulation_movement
=
applied_rule
.
newContent
(
portal_type
=
'Simulation Movement'
,
delivery
=
delivery_line
.
getRelativeUrl
(),
title
=
'Shall be visited by SimulationMovement_buildSlapOS'
)
self
.
tic
()
self
.
portal
.
portal_alarms
.
slapos_trigger_build
.
activeSense
()
self
.
tic
()
self
.
assertNotEqual
(
'Not visited by SimulationMovement_buildSlapOS'
,
simulation_movement
.
getTitle
())
master/bt5/slapos_accounting/bt/revision
View file @
e575bb75
34
35
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_accounting/bt/template_test_id_list
View file @
e575bb75
testSlapOSAccountingConstraint
testSlapOSAccountingConstraint
testSlapOSAccountingHostingSubscriptionSimulation
testSlapOSAccountingHostingSubscriptionSimulation
testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm
testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm
\ No newline at end of file
testSlapOSAccountingSlapOSTriggerBuildAlarm
\ No newline at end of file
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