From 370c182f485087e3f693e6bc22de567ccd5ab577 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 5 Feb 2015 07:12:36 +0100 Subject: [PATCH] Fix header encoding in FakeNetworkReply test stub. This was broken since ef9ddb2d5fcda6851d97938b9c9f5595de97fcd7 but we never noticed it, as an __init__.py was missing in the test folder since 06ec1a3885bd271ffa4dfdfd5b9b228952f9ac14. --- qutebrowser/test/stubs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qutebrowser/test/stubs.py b/qutebrowser/test/stubs.py index a1ce91ea7..cca4c648c 100644 --- a/qutebrowser/test/stubs.py +++ b/qutebrowser/test/stubs.py @@ -136,22 +136,23 @@ class FakeNetworkReply: """Check if the reply has a certain header. Args: - name: The name of the header. + name: The name of the header as ISO-8859-1 encoded bytes object. Return: True if the header is present, False if not. """ - return name in self.headers + return name.decode('iso-8859-1') in self.headers def rawHeader(self, name): """Get the raw header data of a header. Args: - name: The name of the header. + name: The name of the header as ISO-8859-1 encoded bytes object. Return: The header data, as ISO-8859-1 encoded bytes() object. """ + name = name.decode('iso-8859-1') return self.headers[name].encode('iso-8859-1') def header(self, known_header):