[Checkins] SVN: z3c.extfile/trunk/ test fixes and zope.thread removal
Bernd Dorn
bernd.dorn at lovelysystems.com
Mon Jun 21 03:37:57 EDT 2010
Log message for revision 113719:
test fixes and zope.thread removal
Changed:
U z3c.extfile/trunk/CHANGES.txt
U z3c.extfile/trunk/buildout.cfg
U z3c.extfile/trunk/src/z3c/extfile/datamanager.py
U z3c.extfile/trunk/src/z3c/extfile/filter.txt
U z3c.extfile/trunk/src/z3c/extfile/hashdir.txt
U z3c.extfile/trunk/src/z3c/extfile/namespace.txt
-=-
Modified: z3c.extfile/trunk/CHANGES.txt
===================================================================
--- z3c.extfile/trunk/CHANGES.txt 2010-06-20 16:04:46 UTC (rev 113718)
+++ z3c.extfile/trunk/CHANGES.txt 2010-06-21 07:37:56 UTC (rev 113719)
@@ -2,6 +2,11 @@
Changes for z3c.extfile
=======================
+unreleased
+==========
+
+- removed zope.tread and use threading instead
+
0.2.0b2 (2008-07-14)
====================
Modified: z3c.extfile/trunk/buildout.cfg
===================================================================
--- z3c.extfile/trunk/buildout.cfg 2010-06-20 16:04:46 UTC (rev 113718)
+++ z3c.extfile/trunk/buildout.cfg 2010-06-21 07:37:56 UTC (rev 113719)
@@ -1,8 +1,12 @@
[buildout]
develop = .
parts = test
+versions = versions
[test]
recipe = zc.recipe.testrunner
eggs = z3c.extfile [test]
defaults = ['--auto-color']
+
+[versions]
+setuptools = 0.6c9
Modified: z3c.extfile/trunk/src/z3c/extfile/datamanager.py
===================================================================
--- z3c.extfile/trunk/src/z3c/extfile/datamanager.py 2010-06-20 16:04:46 UTC (rev 113718)
+++ z3c.extfile/trunk/src/z3c/extfile/datamanager.py 2010-06-21 07:37:56 UTC (rev 113719)
@@ -1,11 +1,11 @@
-from zope import thread
+import threading
from zope import interface
from zope import component
from transaction.interfaces import IDataManager
import interfaces
import transaction
-_storage = thread.local()
+_storage = threading.local()
def getFile(digest):
if not hasattr(_storage, 'dataManager'):
Modified: z3c.extfile/trunk/src/z3c/extfile/filter.txt
===================================================================
--- z3c.extfile/trunk/src/z3c/extfile/filter.txt 2010-06-20 16:04:46 UTC (rev 113718)
+++ z3c.extfile/trunk/src/z3c/extfile/filter.txt 2010-06-21 07:37:56 UTC (rev 113719)
@@ -112,8 +112,8 @@
>>> from z3c.extfile.hashdir import HashDir
>>> path = os.environ['EXTFILE_STORAGEDIR']
>>> hd = HashDir(path)
- >>> hd.getSize('4934828cf300711df0af9879b0b479c1c18e5707')
- 1026603L
+ >>> int(hd.getSize('4934828cf300711df0af9879b0b479c1c18e5707'))
+ 1026603
Some more type tests because the filter only looks at the first line,
we have to make sure that the types are recognized.
Modified: z3c.extfile/trunk/src/z3c/extfile/hashdir.txt
===================================================================
--- z3c.extfile/trunk/src/z3c/extfile/hashdir.txt 2010-06-20 16:04:46 UTC (rev 113718)
+++ z3c.extfile/trunk/src/z3c/extfile/hashdir.txt 2010-06-21 07:37:56 UTC (rev 113719)
@@ -83,8 +83,8 @@
>>> f.read(10)
'ontent 2'
- >>> f.tell()
- 9L
+ >>> int(f.tell())
+ 9
>>> f.seek(2)
>>> f.read(10)
@@ -123,15 +123,15 @@
>>> for s in ['abc']*1024*500:
... f.write(s)
>>> d = f.commit()
- >>> hd.getSize(d)
- 1536000L
+ >>> int(hd.getSize(d))
+ 1536000
Empty files are also allowed.
>>> f = hd.new()
>>> f.commit()
'da39a3ee5e6b4b0d3255bfef95601890afd80709'
-
+
If no file is in progress the tmp dir of the hd should be empty.
>>> os.listdir(hd.tmp)
@@ -153,4 +153,4 @@
Cleanup
>>> import shutil
- >>> shutil.rmtree(tmp)
+ >>> shutil.rmtree(tmp)
Modified: z3c.extfile/trunk/src/z3c/extfile/namespace.txt
===================================================================
--- z3c.extfile/trunk/src/z3c/extfile/namespace.txt 2010-06-20 16:04:46 UTC (rev 113718)
+++ z3c.extfile/trunk/src/z3c/extfile/namespace.txt 2010-06-21 07:37:56 UTC (rev 113719)
@@ -42,7 +42,7 @@
>>> ns.traverse(u'not a hash', None)
Traceback (most recent call last):
...
- TraversalError: (None, u'not a hash')
+ LocationError: (None, u'not a hash')
Existing hashes return a ReadFile.
@@ -51,12 +51,12 @@
>>> ns.traverse(foo.data2.digest, None)
<ReadFile named '8923e22aa8772e3525dc91f008fc10ce6812b39d'>
-A non existing hash also raises a traversal error.
+A non existing hash also raises a location error.
>>> ns.traverse('b34d7a2ebbef51196b8db24f6233e750d6a30e10', None)
Traceback (most recent call last):
...
- TraversalError: (None, 'b34d7a2ebbef51196b8db24f6233e750d6a30e10')
+ LocationError: (None, 'b34d7a2ebbef51196b8db24f6233e750d6a30e10')
Default Browserview
===================
More information about the checkins
mailing list