Changeset 5357109 in mod_gnutls


Ignore:
Timestamp:
Oct 8, 2020, 3:28:49 PM (14 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master
Children:
83b5bf6
Parents:
c26a163
Message:

Fix flake8 warnings in test hooks.py

Location:
test/tests
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • test/tests/06_invalid_plaintext/hooks.py

    rc26a163 r5357109  
    1313class TLSRecord:
    1414    header = struct.Struct('!BHH')
     15
    1516    def __init__(self, data):
    1617        self.type, self.legacy_proto, self.length = \
     
    4849    """Send an HTTPS request and then plaintext on the same TCP connection"""
    4950    with contextlib.ExitStack() as stack:
    50         s = stack.enter_context(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
     51        s = stack.enter_context(
     52            socket.socket(socket.AF_INET, socket.SOCK_STREAM))
    5153        s.connect((host, port))
    5254
     
    6466        buf = bytearray(2048)
    6567        pos = 0
    66         while not CRLF in buf:
     68        while CRLF not in buf:
    6769            received = tls_sock.recv_into(memoryview(buf)[pos:])
    6870            # If we get 0 it means the connection ended before the
  • test/tests/14_resume_session/hooks.py

    rc26a163 r5357109  
    11import re
    22from mgstest import require_match
     3
    34
    45def post_check(conn_log, response_log):
  • test/tests/15_basic_msva/hooks.py

    rc26a163 r5357109  
    11import os
    22from unittest import SkipTest
     3
    34
    45def prepare_env():
  • test/tests/16_view-status/hooks.py

    rc26a163 r5357109  
    11from mgstest import require_match, TestExpectationFailed
    22import re
     3
    34
    45def post_check(conn_log, response_log):
  • test/tests/24_pkcs11_cert/hooks.py

    rc26a163 r5357109  
    44from pathlib import Path
    55from unittest import SkipTest
     6
    67
    78def prepare_env():
     
    1112    db = 'authority/server/softhsm2.db'
    1213    softhsm_conf = mgstest.softhsm.tmp_softhsm_conf(db)
     14
    1315    def cleanup():
    1416        print(f'Delete {softhsm_conf}')
  • test/tests/27_OCSP_server/hooks.py

    rc26a163 r5357109  
    44from unittest import SkipTest
    55
     6
    67def prepare_env():
    7     if not 'OCSP_PORT' in os.environ:
     8    if 'OCSP_PORT' not in os.environ:
    89        raise SkipTest('OCSP_PORT is not set, check if openssl is available.')
     10
    911
    1012def post_check(conn_log, response_log):
  • test/tests/28_HTTP2_support/hooks.py

    rc26a163 r5357109  
    44from mgstest import require_apache_modules, require_match
    55from unittest import SkipTest
     6
    67
    78def prepare_env():
     
    1415    if not re.search(r'\bHTTP2\b', proc.stdout):
    1516        raise SkipTest(f'{curl} does not support HTTP/2!')
     17
    1618
    1719def run_connection(testname, conn_log, response_log):
     
    3234    proc.check_returncode()
    3335
     36
    3437def post_check(conn_log, response_log):
    3538    print('Checking for HTTP/2 in logged header:')
  • test/tests/30_ip_based_vhosts/hooks.py

    rc26a163 r5357109  
    11import os
    22from unittest import SkipTest
     3
    34
    45def prepare_env():
  • test/tests/34_TLS_reverse_proxy_h2/hooks.py

    rc26a163 r5357109  
    11import mgstest
     2
    23
    34def prepare_env():
  • test/tests/36_OCSP_server_nonce/hooks.py

    rc26a163 r5357109  
    4343        while ocsp_request is None:
    4444            log_match = require_match(
    45                     re.compile(r"Received OCSP request: '([^']*)'"),
    46                     log
    47                 )
     45                re.compile(r"Received OCSP request: '([^']*)'"), log)
    4846            test_request = OCSPRequest.parse_str(
    49                             base64.b64decode(log_match.group(1)))
     47                base64.b64decode(log_match.group(1)))
    5048            print(repr(test_request))
    5149            if ocsp_response.matches_request(test_request):
Note: See TracChangeset for help on using the changeset viewer.