Changeset 6ea34b1 in mod_gnutls


Ignore:
Timestamp:
Dec 4, 2019, 10:00:58 AM (12 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master, proxy-ticket
Children:
ec63b07
Parents:
1de6754
Message:

Rename TestRequest?.check_body() to show it is shared API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/https-test-client.py

    r1de6754 r6ea34b1  
    127127        self.check_response(resp, body)
    128128
    129     def _check_body(self, body):
     129    def check_body(self, body):
    130130        """
    131131        >>> r1 = TestRequest(path='/test.txt', method='GET', headers={}, expect={'status': 200, 'body': {'exactly': 'test\\n'}})
    132         >>> r1._check_body('test\\n')
    133         >>> r1._check_body('xyz\\n')
     132        >>> r1.check_body('test\\n')
     133        >>> r1.check_body('xyz\\n')
    134134        Traceback (most recent call last):
    135135        ...
    136136        https-test-client.TestExpectationFailed: Unexpected body: 'xyz\\n' != 'test\\n'
    137137        >>> r2 = TestRequest(path='/test.txt', method='GET', headers={}, expect={'status': 200, 'body': {'contains': ['tes', 'est']}})
    138         >>> r2._check_body('test\\n')
    139         >>> r2._check_body('est\\n')
     138        >>> r2.check_body('test\\n')
     139        >>> r2.check_body('est\\n')
    140140        Traceback (most recent call last):
    141141        ...
    142142        https-test-client.TestExpectationFailed: Unexpected body: 'est\\n' does not contain 'tes'
    143143        >>> r3 = TestRequest(path='/test.txt', method='GET', headers={}, expect={'status': 200, 'body': {'contains': 'test'}})
    144         >>> r3._check_body('test\\n')
     144        >>> r3.check_body('test\\n')
    145145        """
    146146        if 'exactly' in self.expect['body'] \
     
    168168                f'{self.expect["status"]}')
    169169        if 'body' in self.expect:
    170             self._check_body(body)
     170            self.check_body(body)
    171171
    172172    def expects_conn_reset(self):
     
    278278
    279279        if 'body' in self.expect:
    280             self._check_body(body)
     280            self.check_body(body)
    281281
    282282# Override the default constructors. Pyyaml ignores default parameters
Note: See TracChangeset for help on using the changeset viewer.