Skip to content

Commit

Permalink
Fixing tests under python3
Browse files Browse the repository at this point in the history
  • Loading branch information
kedder committed Feb 28, 2013
1 parent 0b875b9 commit 5d10f9b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
16 changes: 12 additions & 4 deletions buildout.cfg
Expand Up @@ -3,10 +3,12 @@
# http://download.zope.org/zopetoolkit/index/1.1/zopeapp-versions.cfg
# http://download.zope.org/zopetoolkit/index/1.1/ztk-versions.cfg
develop = .
../zope.testbrowser.svn
../zope.app.appsetup
../zope.app.publication
../ZODB
find-links =
${buildout:directory}/zope.app.appsetup-4.0.0a1.dev.tar.gz
${buildout:directory}/zope.app.publication-4.0.0a1.dev.tar.gz
${buildout:directory}/zope.testbrowser-4.0.3dev.tar.gz
${buildout:directory}/ZODB-4.0.0dev.tar.gz

parts = test
versions=versions

Expand All @@ -17,3 +19,9 @@ eggs = zope.app.wsgi [test]
[versions]
zope.i18n = 4.0.0a4
zope.tal=4.0.0a1
ZODB=4.0.0dev
zope.app.appsetup=4.0.0a1.dev
zope.app.publication=4.0.0a1.dev
zope.testbrowser=4.0.3dev
zope.securitypolicy= >=4.0.0a1
zope.session = >=4.0.0a1
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -67,7 +67,7 @@
'zope.security>4.0.0a2',
'zope.component',
'zope.configuration',
'zope.container',
'zope.container >=4.0.0a1',
'zope.error',
'zope.lifecycleevent',
'zope.session >= 4.0.0a1',
Expand Down
2 changes: 1 addition & 1 deletion src/zope/app/wsgi/README.txt
Expand Up @@ -145,7 +145,7 @@ example:
>>> sitezcml = os.path.join(temp_dir, 'site.zcml')
>>> written = open(sitezcml, 'w').write('<configure />')

>>> configFile = io.StringIO('''
>>> configFile = io.StringIO(u'''
... site-definition %s
...
... <zodb>
Expand Down
4 changes: 2 additions & 2 deletions src/zope/app/wsgi/_compat.py
Expand Up @@ -28,5 +28,5 @@
_u = str
import xmlrpc.client as xmlrpcclient
import http.client as httpclient
from io import IOBase
FileType = IOBase
import io
FileType = io._io._IOBase
6 changes: 3 additions & 3 deletions src/zope/app/wsgi/fileresult.txt
Expand Up @@ -26,7 +26,7 @@ Lets look at an example with a regular file object:
>>> request = TestRequest()
>>> result = component.getMultiAdapter((ProxyFactory(f), request), IResult)
>>> for line in result:
... print(line)
... print(line.decode('latin1'))
One
Two
Three
Expand All @@ -39,11 +39,11 @@ Lets look at an example with a regular file object:
We'll see something similar with a temporary file:

>>> t = tempfile.TemporaryFile()
>>> t.write('Three\nTwo\nOne\nHa ha! I love to count down!\n')
>>> written = t.write(b'Three\nTwo\nOne\nHa ha! I love to count down!\n')
>>> request = TestRequest()
>>> result = component.getMultiAdapter((ProxyFactory(t), request), IResult)
>>> for line in result:
... print line
... print(line.decode('latin1'))
Three
Two
One
Expand Down

0 comments on commit 5d10f9b

Please sign in to comment.