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
Eric Zheng
slapos.core
Commits
d2c45581
Commit
d2c45581
authored
Nov 28, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop duplicated code.
parent
72dae5ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
41 deletions
+21
-41
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
..._accounting/TestTemplateItem/testSlapOSAccountingAlarm.py
+20
-40
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 @
d2c45581
...
...
@@ -15,6 +15,26 @@ import tempfile
from
DateTime
import
DateTime
from
Products.ERP5Type.DateUtils
import
addToDate
class
Simulator
:
def
__init__
(
self
,
outfile
,
method
,
to_return
=
None
):
self
.
outfile
=
outfile
open
(
self
.
outfile
,
'w'
).
write
(
repr
([]))
self
.
method
=
method
self
.
to_return
=
to_return
def
__call__
(
self
,
*
args
,
**
kwargs
):
"""Simulation Method"""
old
=
open
(
self
.
outfile
,
'r'
).
read
()
if
old
:
l
=
eval
(
old
)
else
:
l
=
[]
l
.
append
({
'recmethod'
:
self
.
method
,
'recargs'
:
args
,
'reckwargs'
:
kwargs
})
open
(
self
.
outfile
,
'w'
).
write
(
repr
(
l
))
return
self
.
to_return
def
simulateInstance_solveInvoicingGeneration
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -1072,26 +1092,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
request_time_2
,
validated_line_2
.
getStartDate
())
self
.
assertEqual
(
stop_date_2
,
validated_line_2
.
getStopDate
())
class
Simulator
:
def
__init__
(
self
,
outfile
,
method
,
to_return
=
None
):
self
.
outfile
=
outfile
open
(
self
.
outfile
,
'w'
).
write
(
repr
([]))
self
.
method
=
method
self
.
to_return
=
to_return
def
__call__
(
self
,
*
args
,
**
kwargs
):
"""Simulation Method"""
old
=
open
(
self
.
outfile
,
'r'
).
read
()
if
old
:
l
=
eval
(
old
)
else
:
l
=
[]
l
.
append
({
'recmethod'
:
self
.
method
,
'recargs'
:
args
,
'reckwargs'
:
kwargs
})
open
(
self
.
outfile
,
'w'
).
write
(
repr
(
l
))
return
self
.
to_return
def
simulateSimulationMovement_buildSlapOS
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -1297,26 +1297,6 @@ class TestSlapOSTriggerBuildAlarm(testSlapOSMixin):
if
os
.
path
.
exists
(
activate_simulator
):
os
.
unlink
(
activate_simulator
)
class
Simulator
:
def
__init__
(
self
,
outfile
,
method
,
to_return
=
None
):
self
.
outfile
=
outfile
open
(
self
.
outfile
,
'w'
).
write
(
repr
([]))
self
.
method
=
method
self
.
to_return
=
to_return
def
__call__
(
self
,
*
args
,
**
kwargs
):
"""Simulation Method"""
old
=
open
(
self
.
outfile
,
'r'
).
read
()
if
old
:
l
=
eval
(
old
)
else
:
l
=
[]
l
.
append
({
'recmethod'
:
self
.
method
,
'recargs'
:
args
,
'reckwargs'
:
kwargs
})
open
(
self
.
outfile
,
'w'
).
write
(
repr
(
l
))
return
self
.
to_return
def
simulateDelivery_manageBuildingCalculatingDelivery
(
func
):
@
functools
.
wraps
(
func
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
...
...
master/bt5/slapos_accounting/bt/revision
View file @
d2c45581
170
\ No newline at end of file
171
\ 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