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
Thomas Gambier
slapos.core
Commits
c0654bc7
Commit
c0654bc7
authored
Nov 29, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement script testing.
parent
254d6ba7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
3 deletions
+49
-3
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
..._accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
+48
-2
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 @
c0654bc7
...
...
@@ -1410,11 +1410,57 @@ class TestSlapOSDeliverConfirmedAggregatedSalePackingListAlarm(testSlapOSMixin):
self
.
_test
(
'confirmed'
,
'calculating'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
False
)
def
test
(
self
):
raise
NotImplementedError
destination_state
=
'delivered'
@
withAbort
def
_test_script
(
self
,
simulation_state
,
causality_state
,
specialise
,
destination_state
,
consistency_failure
=
False
):
module
=
self
.
portal
.
getDefaultModule
(
portal_type
=
self
.
portal_type
)
delivery
=
module
.
newContent
(
portal_type
=
self
.
portal_type
,
specialise
=
specialise
,
start_date
=
DateTime
())
_jumpToStateFor
=
self
.
portal
.
portal_workflow
.
_jumpToStateFor
_jumpToStateFor
(
delivery
,
simulation_state
)
_jumpToStateFor
(
delivery
,
causality_state
)
def
checkConsistency
(
*
args
,
**
kwargs
):
if
consistency_failure
:
return
[
'bad'
]
else
:
return
[]
try
:
from
Products.ERP5Type.Core.Folder
import
Folder
Folder
.
original_checkConsistency
=
Folder
.
checkConsistency
Folder
.
checkConsistency
=
checkConsistency
getattr
(
delivery
,
self
.
script
)()
finally
:
Folder
.
checkConsistency
=
Folder
.
original_checkConsistency
delattr
(
Folder
,
'original_checkConsistency'
)
self
.
assertEqual
(
destination_state
,
delivery
.
getSimulationState
())
def
test_script_typical
(
self
):
self
.
_test_script
(
'confirmed'
,
'solved'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
self
.
destination_state
)
def
test_script_bad_specialise
(
self
):
self
.
_test_script
(
'confirmed'
,
'solved'
,
None
,
'confirmed'
)
def
test_script_bad_simulation_state
(
self
):
self
.
_test_script
(
'started'
,
'solved'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
'started'
)
def
test_script_bad_causality_state
(
self
):
self
.
_test_script
(
'confirmed'
,
'building'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
'confirmed'
)
def
test_script_bad_consistency
(
self
):
self
.
_test_script
(
'confirmed'
,
'solved'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition'
,
'confirmed'
,
True
)
class
TestSlapOSStopConfirmedAggregatedSaleInvoiceTransactionAlarm
(
TestSlapOSDeliverConfirmedAggregatedSalePackingListAlarm
):
destination_state
=
'stopped'
script
=
'Delivery_stopConfirmedAggregatedSaleInvoiceTransaction'
portal_type
=
'Sale Invoice Transaction'
alarm
=
'slapos_stop_confirmed_aggregated_sale_invoice_transaction'
master/bt5/slapos_accounting/bt/revision
View file @
c0654bc7
175
\ No newline at end of file
176
\ 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