mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
All tests pass on Python 3.
This commit is contained in:
parent
919930173e
commit
2f25950944
@ -1,7 +1,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
from six.moves import cStringIO as StringIO
|
||||
from io import BytesIO
|
||||
from six.moves import urllib, http_client
|
||||
import six
|
||||
import allmydata # for __full_version__
|
||||
@ -39,8 +39,8 @@ class BadResponse(object):
|
||||
|
||||
|
||||
def do_http(method, url, body=""):
|
||||
if isinstance(body, str):
|
||||
body = StringIO(body)
|
||||
if isinstance(body, bytes):
|
||||
body = BytesIO(body)
|
||||
elif isinstance(body, six.text_type):
|
||||
raise TypeError("do_http body must be a bytestring, not unicode")
|
||||
else:
|
||||
|
@ -32,7 +32,7 @@ def _get_json_for_fragment(options, fragment, method='GET', post_args=None):
|
||||
body = ''
|
||||
if post_args is not None:
|
||||
raise ValueError("post_args= only valid for POST method")
|
||||
resp = do_http(method, url, body=body)
|
||||
resp = do_http(method, url, body=body.encode("utf-8"))
|
||||
if isinstance(resp, BadResponse):
|
||||
# specifically NOT using format_http_error() here because the
|
||||
# URL is pretty sensitive (we're doing /uri/<key>).
|
||||
|
@ -95,8 +95,8 @@ class Integration(GridTestMixin, CLITestMixin, unittest.TestCase):
|
||||
d = self.do_cli('status')# '--verbose')
|
||||
|
||||
def _check(ign):
|
||||
code, stdout, stdin = ign
|
||||
self.assertEqual(code, 0)
|
||||
code, stdout, stderr = ign
|
||||
self.assertEqual(code, 0, stderr)
|
||||
self.assertTrue('Skipped 1' in stdout)
|
||||
d.addCallback(_check)
|
||||
return d
|
||||
|
Loading…
Reference in New Issue
Block a user