Changeset 60a415a in mod_gnutls


Ignore:
Timestamp:
Oct 8, 2020, 3:53:04 PM (6 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio
Children:
6cec675
Parents:
83b5bf6
Message:

Fix simple formatting issues reported by flake8

Location:
test/mgstest
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/__init__.py

    r83b5bf6 r60a415a  
    2525from unittest import SkipTest
    2626
     27
    2728class TestExpectationFailed(Exception):
    2829    """Raise if a test failed. The constructor should be called with a
    2930    string describing the problem."""
    3031    pass
    31 
    3232
    3333
     
    5959
    6060
    61 
    6261def first_line_match(regexp, file):
    6362    """Return the first match of the regular expression in file (by line),
     
    7069            return m
    7170    return None
    72 
    7371
    7472
     
    9391
    9492
    95 
    9693def require_apache_modules(*modules):
    9794    """Raise unittest.SkipTest if any of the given module files (full file
  • test/mgstest/hooks.py

    r83b5bf6 r60a415a  
    7272]
    7373
     74
    7475class Plugin:
    7576    """Represents a set of hooks.
     
    9293                setattr(self, hook, None)
    9394
     95
    9496def load_module_file(file_path, module_name):
    9597    """Load a module from a file path."""
     
    98100    spec.loader.exec_module(module)
    99101    return module
     102
    100103
    101104def load_hooks_plugin(file_path, module_name='mgstest.plugin'):
  • test/mgstest/http.py

    r83b5bf6 r60a415a  
    2424from http.client import HTTPConnection
    2525from threading import Thread
     26
    2627
    2728class HTTPSubprocessConnection(HTTPConnection):
     
    6768
    6869        if self._output_filter:
    69             self._sproc = subprocess.Popen(self.command, stdout=subprocess.PIPE,
     70            self._sproc = subprocess.Popen(self.command,
     71                                           stdout=subprocess.PIPE,
    7072                                           stderr=subprocess.PIPE,
    7173                                           stdin=s_remote, close_fds=True,
     
    114116
    115117
    116 
    117118def _stderr_writer(stream, copy=None):
    118119    """Flush incoming data to sys.stderr, and optionally to "copy".
  • test/mgstest/ocsp.py

    r83b5bf6 r60a415a  
    134134    def parse_file(cls, der_filename):
    135135        command = ['ocsptool', '--response-info',
    136                     '--infile', der_filename]
     136                   '--infile', der_filename]
    137137        output = subprocess.check_output(command).decode()
    138138        return cls.parse_ocsptool_output(output)
  • test/mgstest/services.py

    r83b5bf6 r60a415a  
    2121from pathlib import Path
    2222from time import sleep
     23
    2324
    2425class TestService:
     
    147148
    148149
    149 
    150150class ApacheService(TestService):
    151151    """An Apache HTTPD instance used in the mod_gnutls test
     
    168168                         '--track-origins=yes', '--vgdb=no',
    169169                         f'--log-file={valgrind_log}'] \
    170                          + suppress + start_cmd
     170                + suppress + start_cmd
    171171        if not check:
    172172            check = self.pidfile_check
  • test/mgstest/tests.py

    r83b5bf6 r60a415a  
    112112from .http import HTTPSubprocessConnection
    113113
     114
    114115class Transports(Enum):
    115116    """Transports supported by TestConnection."""
     
    119120    def __repr__(self):
    120121        return f'{self.__class__.__name__!s}.{self.name}'
     122
    121123
    122124class TestConnection(yaml.YAMLObject):
     
    198200
    199201
    200 
    201202class TestRequest(yaml.YAMLObject):
    202203    """Test action that sends an HTTP/1.1 request.
     
    214215    """
    215216    yaml_tag = '!request'
     217
    216218    def __init__(self, path, method='GET', body=None, headers=dict(),
    217219                 expect=dict(status=200)):
     
    339341
    340342
    341 
    342343class TestReq10(TestRequest):
    343344    """Test action that sends a request using a minimal (and likely
     
    428429
    429430
    430 
    431431class Resume(yaml.YAMLObject):
    432432    """Test action to close and resume the TLS session.
     
    442442    """
    443443    yaml_tag = '!resume'
     444
    444445    def run(self, conn, command):
    445446        if not '--inline-commands' in command:
     
    450451                            'HTTPSubprocessConnection.')
    451452        conn.sock.send(b'^resume^\n')
    452 
    453453
    454454
     
    506506
    507507
    508 
    509508def format_response(resp, body):
    510509    """Format an http.client.HTTPResponse for logging."""
     
    515514
    516515
    517 
    518516def subst_env(text):
    519517    """Use the parameter "text" as a template, substitute with environment
     
    539537    t = Template(text)
    540538    return t.substitute(os.environ)
    541 
    542539
    543540
  • test/mgstest/valgrind.py

    r83b5bf6 r60a415a  
    2020                    r'\d+ contexts \(suppressed: (\d+) from \d+\)')
    2121
     22
    2223def error_summary(log):
    2324    """Read all available error summaries from the given log (open text
Note: See TracChangeset for help on using the changeset viewer.