Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
275b3389
Commit
275b3389
authored
Nov 15, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove "import Zope" and replace with some slightly less evil stuff
parent
c8a8c175
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
6 deletions
+37
-6
lib/python/Products/Transience/tests/testTimeoutRelated.py
lib/python/Products/Transience/tests/testTimeoutRelated.py
+37
-6
No files found.
lib/python/Products/Transience/tests/testTimeoutRelated.py
View file @
275b3389
...
...
@@ -16,19 +16,49 @@ from Products.PythonScripts.PythonScript import PythonScript
from
ZODB.POSException
import
InvalidObjectReference
from
DateTime
import
DateTime
from
unittest
import
TestCase
,
TestSuite
,
TextTestRunner
,
makeSuite
from
ZODB.DemoStorage
import
DemoStorage
from
OFS.Application
import
Application
import
time
,
threading
,
whrandom
epoch
=
time
.
time
()
stuff
=
{}
def
_getApp
():
app
=
stuff
.
get
(
'app'
,
None
)
if
not
app
:
ds
=
DemoStorage
(
quota
=
(
1
<<
20
))
db
=
ZODB
.
DB
(
ds
)
conn
=
db
.
open
()
root
=
conn
.
root
()
app
=
Application
()
root
[
'Application'
]
=
app
get_transaction
().
commit
()
stuff
[
'app'
]
=
app
stuff
[
'conn'
]
=
conn
stuff
[
'db'
]
=
db
return
app
def
_openApp
():
conn
=
stuff
[
'db'
].
open
()
root
=
conn
.
root
()
app
=
root
[
'Application'
]
return
conn
,
app
def
_delApp
():
get_transaction
().
abort
()
stuff
[
'conn'
].
close
()
del
stuff
[
'conn'
]
del
stuff
[
'app'
]
del
stuff
[
'db'
]
class
TestBase
(
TestCase
):
def
setUp
(
self
):
import
Zope
Products
.
Transience
.
Transience
.
time
=
fauxtime
self
.
app
=
makerequest
.
makerequest
(
Zope
.
app
())
del
Zope
self
.
app
=
makerequest
.
makerequest
(
_getApp
())
timeout
=
self
.
timeout
=
1
...
...
@@ -41,8 +71,9 @@ class TestBase(TestCase):
def
tearDown
(
self
):
get_transaction
().
abort
()
self
.
app
.
_p_jar
.
close
()
self
.
app
=
None
#self.app._p_jar.close()
#self.app = None
_delApp
()
del
self
.
app
class
TestLastAccessed
(
TestBase
):
...
...
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