/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_http.py

  • Committer: Martin
  • Date: 2018-06-30 22:18:39 UTC
  • mfrom: (7010 work)
  • mto: This revision was merged to the branch mainline in revision 7012.
  • Revision ID: gzlist@googlemail.com-20180630221839-98zi78xwcggestse
Merge trunk to fix conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
1203
1203
 
1204
1204
    def assertProxied(self):
1205
1205
        t = self.get_readonly_transport()
1206
 
        self.assertEqual('proxied contents of foo\n', t.get('foo').read())
 
1206
        self.assertEqual(b'proxied contents of foo\n', t.get('foo').read())
1207
1207
 
1208
1208
    def assertNotProxied(self):
1209
1209
        t = self.get_readonly_transport()
1210
 
        self.assertEqual('contents of foo\n', t.get('foo').read())
 
1210
        self.assertEqual(b'contents of foo\n', t.get('foo').read())
1211
1211
 
1212
1212
    def test_http_proxy(self):
1213
1213
        self.overrideEnv('http_proxy', self.proxy_url)
1810
1810
        httpd = self.http_server.server
1811
1811
 
1812
1812
        socket = SampleSocket(
1813
 
            'POST /.bzr/smart %s \r\n' % self._protocol_version
 
1813
            b'POST /.bzr/smart %s \r\n' % self._protocol_version.encode('ascii')
1814
1814
            # HTTP/1.1 posts must have a Content-Length (but it doesn't hurt
1815
1815
            # for 1.0)
1816
 
            + 'Content-Length: 6\r\n'
1817
 
            '\r\n'
1818
 
            'hello\n')
 
1816
            + b'Content-Length: 6\r\n'
 
1817
            b'\r\n'
 
1818
            b'hello\n')
1819
1819
        # Beware: the ('localhost', 80) below is the
1820
1820
        # client_address parameter, but we don't have one because
1821
1821
        # we have defined a socket which is not bound to an
1827
1827
        response = socket.writefile.getvalue()
1828
1828
        self.assertStartsWith(response, '%s 200 ' % self._protocol_version)
1829
1829
        # This includes the end of the HTTP headers, and all the body.
1830
 
        expected_end_of_response = '\r\n\r\nok\x012\n'
 
1830
        expected_end_of_response = b'\r\n\r\nok\x012\n'
1831
1831
        self.assertEndsWith(response, expected_end_of_response)
1832
1832
 
1833
1833