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
8cbeb194
Commit
8cbeb194
authored
Nov 29, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement alarm selection testing.
parent
30b529c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
4 deletions
+48
-4
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
..._accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
+47
-3
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
View file @
8cbeb194
...
...
@@ -1368,9 +1368,53 @@ class TestSlapOSManageBuildingCalculatingDeliveryAlarm(testSlapOSMixin):
self
.
_test_Delivery_manageBuildingCalculatingDelivery
(
'diverged'
,
True
)
class
TestSlapOSDeliverConfirmedAggregatedSalePackingListAlarm
(
testSlapOSMixin
):
def
test
(
self
):
raise
NotImplementedError
script
=
'Delivery_deliverConfirmedAggregatedSalePackingList'
portal_type
=
'Sale Packing List'
alarm
=
'slapos_deliver_confirmed_aggregated_sale_packing_list'
def
_test
(
self
,
simulation_state
,
causality_state
,
specialise
,
positive
):
@
simulateByTitlewMark
(
self
.
script
)
def
_real
(
self
,
simulation_state
,
causality_state
,
specialise
,
positive
):
not_visited
=
'Not visited by %s'
%
self
.
script
visited
=
'Visited by %s'
%
self
.
script
module
=
self
.
portal
.
getDefaultModule
(
portal_type
=
self
.
portal_type
)
delivery
=
module
.
newContent
(
title
=
not_visited
,
portal_type
=
self
.
portal_type
,
specialise
=
specialise
)
_jumpToStateFor
=
self
.
portal
.
portal_workflow
.
_jumpToStateFor
_jumpToStateFor
(
delivery
,
simulation_state
)
_jumpToStateFor
(
delivery
,
causality_state
)
self
.
tic
()
alarm
=
getattr
(
self
.
portal
.
portal_alarms
,
self
.
alarm
)
alarm
.
activeSense
()
self
.
tic
()
if
positive
:
self
.
assertEqual
(
visited
,
delivery
.
getTitle
())
else
:
self
.
assertEqual
(
not_visited
,
delivery
.
getTitle
())
_real
(
self
,
simulation_state
,
causality_state
,
specialise
,
positive
)
def
test_typical
(
self
):
self
.
_test
(
'confirmed'
,
'solved'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
True
)
def
test_bad_specialise
(
self
):
self
.
_test
(
'confirmed'
,
'solved'
,
None
,
False
)
def
test_bad_simulation_state
(
self
):
self
.
_test
(
'started'
,
'solved'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
False
)
def
test_bad_causality_state
(
self
):
self
.
_test
(
'confirmed'
,
'calculating'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
False
)
class
TestSlapOSStopConfirmedAggregatedSaleInvoiceTransactionAlarm
(
testSlapOSMixin
):
def
test
(
self
):
raise
NotImplementedError
class
TestSlapOSStopConfirmedAggregatedSaleInvoiceTransactionAlarm
(
TestSlapOSDeliverConfirmedAggregatedSalePackingListAlarm
):
script
=
'Delivery_stopConfirmedAggregatedSaleInvoiceTransaction'
portal_type
=
'Sale Invoice Transaction'
alarm
=
'slapos_stop_confirmed_aggregated_sale_invoice_transaction'
master/bt5/slapos_accounting/bt/revision
View file @
8cbeb194
173
\ No newline at end of file
174
\ 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