/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/http_utils.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from cStringIO import StringIO
18
17
import re
19
18
import urllib2
20
19
 
21
20
 
22
 
from breezy import (
 
21
from .. import (
23
22
    errors,
24
23
    osutils,
25
24
    tests,
26
25
    transport,
27
26
    )
28
 
from breezy.smart import (
 
27
from ..sixish import (
 
28
    BytesIO,
 
29
    )
 
30
from ..smart import (
29
31
    medium,
30
32
    )
31
 
from breezy.tests import http_server
32
 
from breezy.transport import chroot
 
33
from . import http_server
 
34
from ..transport import chroot
33
35
 
34
36
 
35
37
class HTTPServerWithSmarts(http_server.HttpServer):
81
83
        request_bytes = self.rfile.read(data_length)
82
84
        protocol_factory, unused_bytes = medium._get_protocol_factory_for_bytes(
83
85
            request_bytes)
84
 
        out_buffer = StringIO()
 
86
        out_buffer = BytesIO()
85
87
        smart_protocol_request = protocol_factory(t, out_buffer.write, '/')
86
88
        # Perhaps there should be a SmartServerHTTPMedium that takes care of
87
89
        # feeding the bytes in the http request to the smart_protocol_request,
446
448
        if realm != self.auth_realm:
447
449
            return False
448
450
        user = auth['username']
449
 
        if not self.password_of.has_key(user):
 
451
        if user not in self.password_of:
450
452
            return False
451
453
        algorithm= auth['algorithm']
452
454
        if algorithm != 'MD5':