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
Jérome Perrin
slapos.core
Commits
4ed26f94
Commit
4ed26f94
authored
Nov 20, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Share method in module.
parent
e4437488
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
22 deletions
+12
-22
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
..._accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
+1
-10
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingRule.py
...s_accounting/TestTemplateItem/testSlapOSAccountingRule.py
+1
-12
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+10
-0
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
View file @
4ed26f94
...
@@ -9,7 +9,7 @@ import transaction
...
@@ -9,7 +9,7 @@ import transaction
import
functools
import
functools
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.SlapOS.tests.testSlapOSMixin
import
\
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
testSlapOSMixin
,
withAbort
import
os
import
os
import
tempfile
import
tempfile
from
DateTime
import
DateTime
from
DateTime
import
DateTime
...
@@ -1175,15 +1175,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
...
@@ -1175,15 +1175,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
request_time_2
,
validated_line_2
.
getStartDate
())
self
.
assertEqual
(
request_time_2
,
validated_line_2
.
getStartDate
())
self
.
assertEqual
(
stop_date_2
,
validated_line_2
.
getStopDate
())
self
.
assertEqual
(
stop_date_2
,
validated_line_2
.
getStopDate
())
def
withAbort
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
try
:
func
(
self
,
*
args
,
**
kwargs
)
finally
:
transaction
.
abort
()
return
wrapped
class
Simulator
:
class
Simulator
:
def
__init__
(
self
,
outfile
,
method
,
to_return
=
None
):
def
__init__
(
self
,
outfile
,
method
,
to_return
=
None
):
self
.
outfile
=
outfile
self
.
outfile
=
outfile
...
...
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingRule.py
View file @
4ed26f94
...
@@ -6,20 +6,9 @@
...
@@ -6,20 +6,9 @@
##############################################################################
##############################################################################
from
Products.SlapOS.tests.testSlapOSMixin
import
\
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
testSlapOSMixin
,
withAbort
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.DateUtils
import
addToDate
from
Products.ERP5Type.DateUtils
import
addToDate
import
transaction
import
functools
def
withAbort
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
try
:
func
(
self
,
*
args
,
**
kwargs
)
finally
:
transaction
.
abort
()
return
wrapped
class
TestDefaultInvoiceTransactionRule
(
testSlapOSMixin
):
class
TestDefaultInvoiceTransactionRule
(
testSlapOSMixin
):
@
withAbort
@
withAbort
...
...
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
4ed26f94
...
@@ -30,8 +30,18 @@ import random
...
@@ -30,8 +30,18 @@ import random
import
transaction
import
transaction
import
unittest
import
unittest
import
Products.Vifib.tests.VifibMixin
import
Products.Vifib.tests.VifibMixin
import
functools
from
Products.ERP5Type.tests.utils
import
DummyMailHost
from
Products.ERP5Type.tests.utils
import
DummyMailHost
def
withAbort
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
try
:
func
(
self
,
*
args
,
**
kwargs
)
finally
:
transaction
.
abort
()
return
wrapped
class
testSlapOSMixin
(
Products
.
Vifib
.
tests
.
VifibMixin
.
testVifibMixin
):
class
testSlapOSMixin
(
Products
.
Vifib
.
tests
.
VifibMixin
.
testVifibMixin
):
def
_setUpDummyMailHost
(
self
):
def
_setUpDummyMailHost
(
self
):
...
...
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