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 Leymonerie
slapos.core
Commits
30b529c5
Commit
30b529c5
authored
Nov 28, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid super usage.
Yep, Luke is nice again for live test system.
parent
36f7389a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
20 deletions
+25
-20
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
..._accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
+24
-19
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 @
30b529c5
...
...
@@ -81,9 +81,11 @@ if context.getTitle() == 'Not visited by %s':
return
wrapper
class
TestInstanceInvoicingAlarm
(
testSlapOSMixin
):
def
afterSetUp
(
self
):
super
(
TestInstanceInvoicingAlarm
,
self
).
afterSetUp
()
@
withAbort
def
test_noSaleOrderPackingList_newSoftwareInstance
(
self
):
"""
Be sure no delivery is created synchronously (break old code behaviour)
"""
self
.
software_instance_request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_type
=
self
.
generateNewSoftwareType
(),
...
...
@@ -91,22 +93,6 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
)
self
.
slave_instance_request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
True
,
)
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
test_noSaleOrderPackingList_newSoftwareInstance
(
self
):
"""
Be sure no delivery is created synchronously (break old code behaviour)
"""
instance
=
self
.
portal
.
software_instance_module
.
template_software_instance
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
instance
.
edit
(
title
=
"TESTSI-%s"
%
self
.
generateNewId
())
...
...
@@ -114,10 +100,19 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
assertEqual
(
None
,
instance
.
getCausalityValue
())
@
withAbort
def
test_noSaleOrderPackingList_newSlaveInstance
(
self
):
"""
Be sure no delivery is created synchronously (break old code behaviour)
"""
self
.
slave_instance_request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
True
,
)
instance
=
self
.
portal
.
software_instance_module
.
template_slave_instance
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
instance
.
edit
(
title
=
"TESTSI-%s"
%
self
.
generateNewId
())
...
...
@@ -168,6 +163,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
'Visited by Instance_solveInvoicingGeneration'
,
instance
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
@
withAbort
def
test_solved_instance
(
self
):
instance
=
self
.
portal
.
software_instance_module
\
.
template_slave_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -193,6 +189,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
assertEqual
(
instance
.
getCausalityState
(),
'solved'
)
self
.
assertEqual
(
None
,
instance
.
getCausalityValue
())
@
withAbort
def
test_instance_in_draft_state
(
self
):
instance
=
self
.
portal
.
software_instance_module
\
.
template_slave_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -216,6 +213,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
assertEqual
(
instance
.
getCausalityState
(),
'solved'
)
self
.
assertEqual
(
None
,
instance
.
getCausalityValue
())
@
withAbort
def
test_instance_in_unknown_state
(
self
):
instance
=
self
.
portal
.
software_instance_module
\
.
template_slave_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -237,6 +235,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
assertRaises
(
AssertionError
,
instance
.
Instance_solveInvoicingGeneration
)
@
withAbort
def
test_instance_in_early_destroyed_state
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -308,6 +307,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
[
instance
,
subscription
])
self
.
assertEqual
(
len
(
movement
.
contentValues
()),
0
)
@
withAbort
def
test_instance_create_non_destroyed_state
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -348,6 +348,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
check_instance_delivery
(
delivery
,
start_date
,
stop_date
,
person
,
1
)
self
.
check_instance_movement
(
setup_line
,
instance
,
subscription
,
1
)
@
withAbort
def
test_instance_create_non_destroyed_with_update_state
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -405,6 +406,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
check_instance_movement
(
setup_line
,
instance
,
subscription
,
1
)
self
.
check_instance_movement
(
update_line
,
instance
,
subscription
,
2
)
@
withAbort
def
test_instance_create_destroyed_with_update_state
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -463,6 +465,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
check_instance_movement
(
update_line
,
instance
,
subscription
,
1
)
self
.
check_instance_movement
(
destroy_line
,
instance
,
subscription
,
1
)
@
withAbort
def
test_instance_update_non_destroyed_state
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -522,6 +525,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
check_instance_delivery
(
delivery
,
start_date
,
stop_date
,
person
,
1
)
self
.
check_instance_movement
(
update_line
,
instance
,
subscription
,
2
)
@
withAbort
def
test_instance_update_destroyed_state
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -582,6 +586,7 @@ class TestInstanceInvoicingAlarm(testSlapOSMixin):
self
.
check_instance_movement
(
update_line
,
instance
,
subscription
,
1
)
self
.
check_instance_movement
(
destroy_line
,
instance
,
subscription
,
1
)
@
withAbort
def
test_instance_update_already_destroyed
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
master/bt5/slapos_accounting/bt/revision
View file @
30b529c5
172
\ No newline at end of file
173
\ 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