/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 bzrlib/tests/HTTPTestUtil.py

  • Committer: Vincent Ladeuil
  • Date: 2007-10-24 13:56:34 UTC
  • mto: (3928.1.1 bzr.integration)
  • mto: This revision was merged to the branch mainline in revision 3929.
  • Revision ID: v.ladeuil+lp@free.fr-20071024135634-d8os3by1g6f45q12
Fix python2.6 deprecation warnings (still 4 failures 5 errors in test suite).

* bzrlib/osutils.py: 
Wrap md5 and sha imports to be compatible with python 2.4, 2.5,
2.6.
Replace all sha.new() calls by sha() calls they are reputedly
faster (not profiled).

* bzrlib/weave.py: 
Update sha import, fix use.     

* bzrlib/transport/http/_urllib2_wrappers.py: 
Update sha and md5 imports, fix uses.

* bzrlib/tests/test_testament.py: 
Update sha import.

* bzrlib/tests/test_knit.py: 
Update sha import, fix uses.    

* bzrlib/tests/test_hashcache.py: 
Update sha import, fix use.     

* bzrlib/tests/repository_implementations/test_check_reconcile.py: 
Update sha import, fix use.     

* bzrlib/tests/HTTPTestUtil.py: 
Update md5 import, fix uses. Delete useless sha import.

* bzrlib/testament.py: 
Update sha import.

* bzrlib/hashcache.py: 
Update sha import.

* bzrlib/revisionspec.py:
(RevisionSpec.__new__): Remove useless parameters since python2.6
is stricter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from cStringIO import StringIO
18
18
import errno
19
 
import md5
20
19
from SimpleHTTPServer import SimpleHTTPRequestHandler
21
20
import re
22
 
import sha
23
21
import socket
24
22
import time
25
23
import urllib2
26
24
import urlparse
27
25
 
 
26
from bzrlib.osutils import md5
28
27
from bzrlib.smart import protocol
29
28
from bzrlib.tests import TestCaseWithTransport
30
29
from bzrlib.tests.HttpServer import (
500
499
        A1 = '%s:%s:%s' % (user, realm, password)
501
500
        A2 = '%s:%s' % (command, auth['uri'])
502
501
 
503
 
        H = lambda x: md5.new(x).hexdigest()
 
502
        H = lambda x: md5(x).hexdigest()
504
503
        KD = lambda secret, data: H("%s:%s" % (secret, data))
505
504
 
506
505
        nonce_count = int(auth['nc'], 16)