mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
Tests pass on Python 3.
This commit is contained in:
parent
c076e1ee26
commit
4940da47da
@ -9,6 +9,8 @@ from __future__ import (
|
||||
division,
|
||||
)
|
||||
|
||||
from future.builtins import str
|
||||
|
||||
from testtools.matchers import (
|
||||
Equals,
|
||||
)
|
||||
@ -56,6 +58,7 @@ class PrivacyTests(SyncTestCase):
|
||||
return super(PrivacyTests, self).setUp()
|
||||
|
||||
def _authorization(self, scheme, value):
|
||||
value = str(value, "utf-8")
|
||||
return Headers({
|
||||
u"authorization": [u"{} {}".format(scheme, value)],
|
||||
})
|
||||
@ -90,7 +93,7 @@ class PrivacyTests(SyncTestCase):
|
||||
self.assertThat(
|
||||
self.client.head(
|
||||
b"http:///foo/bar",
|
||||
headers=self._authorization(SCHEME, u"foo bar"),
|
||||
headers=self._authorization(str(SCHEME, "utf-8"), b"foo bar"),
|
||||
),
|
||||
succeeded(has_response_code(Equals(UNAUTHORIZED))),
|
||||
)
|
||||
@ -103,7 +106,7 @@ class PrivacyTests(SyncTestCase):
|
||||
self.assertThat(
|
||||
self.client.head(
|
||||
b"http:///foo/bar",
|
||||
headers=self._authorization(SCHEME, self.token),
|
||||
headers=self._authorization(str(SCHEME, "utf-8"), self.token),
|
||||
),
|
||||
# It's a made up URL so we don't get a 200, either, but a 404.
|
||||
succeeded(has_response_code(Equals(NOT_FOUND))),
|
||||
|
Loading…
x
Reference in New Issue
Block a user