~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http_response.py

  • Committer: Vincent Ladeuil
  • Date: 2008-09-11 19:36:38 UTC
  • mfrom: (3703 +trunk)
  • mto: (3705.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 3708.
  • Revision ID: v.ladeuil+lp@free.fr-20080911193638-wtjyc1kcmacc6t1f
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Tests from HTTP response parsing.
18
18
 
96
96
        # Override the thresold to force the warning emission
97
97
        conn._range_warning_thresold = 6 # There are 7 bytes pending
98
98
        conn.cleanup_pipe()
99
 
        self.assertContainsRe(self.get_log(), 'Got a 200 response when asking')
 
99
        self.assertContainsRe(self._get_log(keep_log_file=True),
 
100
                              'Got a 200 response when asking')
100
101
 
101
102
 
102
103
class TestRangeFileMixin(object):
406
407
 
407
408
 
408
409
class TestRangeFileMultipleRangesQuotedBoundaries(TestRangeFileMultipleRanges):
409
 
    """Perform the same tests as TestRangeFileMultipleRanges, but uses
 
410
    """Perform the same tests as TestRangeFileMultipleRanges, but uses 
410
411
    an angle-bracket quoted boundary string like IIS 6.0 and 7.0
411
412
    (but not IIS 5, which breaks the RFC in a different way
412
413
    by using square brackets, not angle brackets)
413
 
 
414
 
    This reveals a bug caused by
415
 
 
416
 
    - The bad implementation of RFC 822 unquoting in Python (angles are not
417
 
      quotes), coupled with
 
414
    
 
415
    This reveals a bug caused by 
 
416
    
 
417
    - The bad implementation of RFC 822 unquoting in Python (angles are not 
 
418
      quotes), coupled with 
418
419
 
419
420
    - The bad implementation of RFC 2046 in IIS (angles are not permitted chars
420
421
      in boundary lines).
421
 
 
 
422
 
422
423
    """
423
424
    # The boundary as it appears in boundary lines
424
425
    # IIS 6 and 7 use this value
800
801
    """
801
802
 
802
803
    def setUp(self):
803
 
        tests.TestCase.setUp(self)
804
804
        # create a test datablock larger than _max_read_size.
805
805
        chunk_size = response.RangeFile._max_read_size
806
806
        test_pattern = '0123456789ABCDEF'