]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: change whitespace and comments in Python test code
authorDan Fandrich <dan@coneharvesters.com>
Sat, 25 Jul 2026 20:35:51 +0000 (13:35 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 28 Jul 2026 15:52:01 +0000 (08:52 -0700)
* remove an unneeded ruff warning disable
* remove coding: utf-8 from Python code; PEP 3120 makes UTF-8 the
  default encoding
* remove unusable shebang lines from Python code
* remove empty print strings
* disable warnings when file objects are stored; these instances can't
  be handled with context managers
* use more consistent whitespace in Python code, fixing flake8 warnings
* set the executable bit on scorecard.py, making it easier to run

These fix ruff rules EXE001, FURB105, UP009, SIM115.

51 files changed:
tests/dictserver.py
tests/ech_combos.py
tests/http/scorecard.py [changed mode: 0644->0755]
tests/http/test_01_basic.py
tests/http/test_02_download.py
tests/http/test_03_goaway.py
tests/http/test_04_stuttered.py
tests/http/test_05_errors.py
tests/http/test_06_eyeballs.py
tests/http/test_07_upload.py
tests/http/test_08_caddy.py
tests/http/test_09_push.py
tests/http/test_10_proxy.py
tests/http/test_11_unix.py
tests/http/test_12_reuse.py
tests/http/test_13_proxy_auth.py
tests/http/test_14_auth.py
tests/http/test_15_tracing.py
tests/http/test_16_info.py
tests/http/test_17_ssl_use.py
tests/http/test_18_methods.py
tests/http/test_19_shutdown.py
tests/http/test_20_websockets.py
tests/http/test_21_resolve.py
tests/http/test_22_httpsrr.py
tests/http/test_30_vsftpd.py
tests/http/test_31_vsftpds.py
tests/http/test_32_ftps_vsftpd.py
tests/http/test_40_socks.py
tests/http/test_50_scp.py
tests/http/test_51_sftp.py
tests/http/test_60_h3_proxy.py
tests/http/testenv/__init__.py
tests/http/testenv/caddy.py
tests/http/testenv/certs.py
tests/http/testenv/client.py
tests/http/testenv/curl.py
tests/http/testenv/dante.py
tests/http/testenv/dnsd.py
tests/http/testenv/env.py
tests/http/testenv/h2o.py
tests/http/testenv/httpd.py
tests/http/testenv/nghttpx.py
tests/http/testenv/ports.py
tests/http/testenv/sshd.py
tests/http/testenv/vsftpd.py
tests/http/testenv/ws_4frames_server.py
tests/http/testenv/ws_echo_server.py
tests/negtelnetserver.py
tests/smbserver.py
tests/util.py

index 4419e11582eeef316842fba5e29b4e1026a7f80e..ea9f586c44d25fbf3f2324de72cec1eb1bfd5211 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 8b15eff41fe135c36d53d1475f5c030a47b71f9d..90db92ca91d03a01a83d34bdd0437299ef1c03b6 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -45,12 +44,12 @@ def CombinationRepetitionUtil(chosen, arr, badarr, index,
             if chosen[j] in badarr:
                 res = 0
             j = j - 1
-        print("cli_test $turl 1", res, end = " ")
+        print("cli_test $turl 1", res, end=" ")
         # print combination but eliminating any runs of
         # two identical params
         for j in range(r):
             if j != 0 and chosen[j] != chosen[j-1]:
-                print(chosen[j], end = " ")
+                print(chosen[j], end=" ")
 
         print()
         return
@@ -89,8 +88,8 @@ def CombinationRepetition(arr, badarr, n, r):
 
 
 # Driver code
-badarr = [ '--ech grease', '--ech false', '--ech ecl:$badecl', '--ech pn:$badpn' ]
-goodarr = [ '--ech hard', '--ech true', '--ech ecl:$goodecl',  '--ech pn:$goodpn' ]
+badarr = ['--ech grease', '--ech false', '--ech ecl:$badecl', '--ech pn:$badpn']
+goodarr = ['--ech hard', '--ech true', '--ech ecl:$goodecl',  '--ech pn:$goodpn']
 arr = badarr + goodarr
 r = 8
 n = len(arr) - 1
old mode 100644 (file)
new mode 100755 (executable)
index 95e0926..1550ccb
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -211,7 +210,7 @@ class Card:
                 print(f'  {col:>{colw[idx]}} {"[cpu/rss]":<{statw}}', end='')
             else:
                 print(f'  {col:>{colw[idx]}}', end='')
-        print('')
+        print()
         for row in rows:
             for idx, cell in enumerate(row):
                 print(f'  {cell["sval"]:>{colw[idx]}}', end='')
@@ -224,7 +223,7 @@ class Card:
                     print(f' {s:<{statw}}', end='')
                 if 'errors' in cell:
                     errors.extend(cell['errors'])
-            print('')
+            print()
         if len(errors):
             print(f'Errors: {errors}')
 
@@ -647,13 +646,15 @@ class ScoreRunner:
         rows = []
         mparallel = meta['request_parallels']
         cols.extend([f'{mp} max' for mp in mparallel])
-        row = [{
-            'val': fsize,
-            'sval': Card.fmt_size(fsize)
-        },{
-            'val': count,
-            'sval': f'{count}',
-        }]
+        row = [
+                {
+                    'val': fsize,
+                    'sval': Card.fmt_size(fsize)
+                }, {
+                    'val': count,
+                        'sval': f'{count}',
+                }
+        ]
         self.info('requests, max parallel...')
         row.extend([self.do_requests(url=url, count=count,
                                      max_parallel=mp, nsamples=meta["samples"])
@@ -992,7 +993,7 @@ def main():
     parser.add_argument("--remote", action='store', type=str,
                         default=None, help="score against the remote server at <ip>:<port>")
     parser.add_argument("--flame", action='store_true',
-                        default = False, help="produce a flame graph on curl")
+                        default=False, help="produce a flame graph on curl")
     parser.add_argument("--limit-rate", action='store', type=str,
                         default=None, help="use curl's --limit-rate")
     parser.add_argument("--http-plain", action='store_true',
index 86f7ad191f18f7dea59d4ebb94d1648b15f3bf8f..24e03d19b82455fc946c7196878a31a4a519b038 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 413d518a6ea4c57955e086aa8317712bd9261319..437db80ae4a054efce302c03a3c1260c17becc2e 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -141,8 +139,8 @@ class TestDownload:
         urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]'
         r = curl.http_download(urls=[urln], alpn_proto=proto,
                                with_stats=True, extra_args=[
-            '--parallel', '--parallel-max', '200'
-        ])
+                                   '--parallel', '--parallel-max', '200'
+                               ])
         r.check_response(http_status=200, count=count)
         # should have used at most 2 connections only (test servers allow 100 req/conn)
         # it may be 1 on slow systems where request are answered faster than
@@ -157,8 +155,8 @@ class TestDownload:
         urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]'
         r = curl.http_download(urls=[urln], alpn_proto=proto,
                                with_stats=True, extra_args=[
-            '--parallel'
-        ])
+                                   '--parallel'
+                               ])
         r.check_response(count=count, http_status=200)
         # http/1.1 should have used count connections
         assert r.total_connects == count, "http/1.1 should use this many connections"
index 4c57bf2715d0a3a6f0181ef07328a763449c70e1..36febdbd18a56e37a165aab1537d3bf450f4013b 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 1c578e2e9e77bed3d1a8e66bdb7b6cab5033db0b..3ad25d93ae43f3a14f3f08fc006267c5a54a59fc 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 60a9aaa2e49b9f6248e9bf63cb1af3018e7ceb1c..768416eea33154c3e47fec10df9be27103778782 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 1dc3726f4887626abc57586cbc440b1005ad9b86..b72a89d75e4c95787e09eedb92f5b8188e037e1c 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -129,7 +127,7 @@ class TestEyeballs:
         assert r.stats[0]['time_connect'] == 0     # no one connected
         # check that we indeed started attempts on all 3 addresses
         tcp_attempts = [line for line in r.trace_lines
-                         if re.match(r'.*Trying \[100::[123]]:443', line)]
+                        if re.match(r'.*Trying \[100::[123]]:443', line)]
         assert len(tcp_attempts) == 3, f'fond: {"".join(tcp_attempts)}\n{r.dump_logs()}'
         # if the 0100::/64 really goes into the void, we should see 2 HAPPY_EYEBALLS
         # timeouts being set here
index 6cb4d943e1558f7b86261c71f5ef4cd4890f2534..7ad396d73c3835659a1e6754d9433d33da3c5d10 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -549,7 +547,7 @@ class TestUpload:
         ])
         r.check_exit_code(0)
         results = [int(m.group(1)) for line in r.trace_lines
-                     if (m := re.match(r'.* FINISHED, result=(\d+), response=(\d+)', line))]
+                   if (m := re.match(r'.* FINISHED, result=(\d+), response=(\d+)', line))]
         httpcodes = [int(m.group(2)) for line in r.trace_lines
                      if (m := re.match(r'.* FINISHED, result=(\d+), response=(\d+)', line))]
         if httpcode == 308:
@@ -568,8 +566,8 @@ class TestUpload:
         url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-0]'
         r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto,
                           with_headers=True, extra_args=[
-            '--limit-rate', f'{speed_limit}'
-        ])
+                              '--limit-rate', f'{speed_limit}'
+                          ])
         r.check_response(count=count, http_status=200)
         assert r.responses[0]['header']['received-length'] == f'{up_len}', f'{r.responses[0]}'
         up_speed = r.stats[0]['speed_upload']
@@ -585,8 +583,8 @@ class TestUpload:
         url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]'
         r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto,
                              with_headers=True, extra_args=[
-            '--limit-rate', f'{speed_limit}'
-        ])
+                                 '--limit-rate', f'{speed_limit}'
+                             ])
         r.check_response(count=count, http_status=200)
         up_speed = r.stats[0]['speed_upload']
         assert up_speed <= (speed_limit * 1.1), f'{r.stats[0]}'
index 23cea4582ab81ca1d8e10793a2d6753436191bd8..70413a84d5448aec1c7bd3f2e8fa8a7f8475f5f2 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 386289b39e973c836c2659beba2989a1130a4bf8..7fb37b679df36274cd3c733a958817c4b05aa1c5 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 7ef77465bc54d28c3119dec33ac3622b86e30077..bd07841a68c0f641a8ea16439d6d8d36aa48e27b 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index b4e5ac79742b03dceb53be387fa91cafc477dc69..6ba500e1ce52a2e09bfa2993d83883a87ac14ea6 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index d4e2f70861a2a0eb7dcc30489b1de039b3ffd5bc..b7a2513ef0fb2ebd3169064ad8e4f2e3c8788370 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 50e45960575d0ef7e0978a8178723b10e668dbed..4e5d45e91882cbf283a6b834f2e6bdf4e6e95b5d 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -175,9 +173,9 @@ class TestProxyAuth:
         url2 = f'http://localhost:{env.http_port}/data.json?2'
         url3 = f'http://localhost:{env.http_port}/data.json?3'
         xargs1 = curl.get_proxy_args(proxys=False, tunnel=True)
-        xargs1.extend(['--proxy-user', 'proxy:proxy']) # good auth
+        xargs1.extend(['--proxy-user', 'proxy:proxy'])  # good auth
         xargs2 = curl.get_proxy_args(proxys=False, tunnel=True)
-        xargs2.extend(['--proxy-user', 'ungood:ungood']) # bad auth
+        xargs2.extend(['--proxy-user', 'ungood:ungood'])  # bad auth
         xargs3 = curl.get_proxy_args(proxys=False, tunnel=True)
         # no auth
         r = curl.http_download(urls=[url1, url2, url3], alpn_proto='http/1.1', with_stats=True,
index ca808e007795ae212abda916882b75ad5ff34934..268ebae5141e506b335364101e2a34975b50e439 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -64,7 +62,7 @@ class TestAuth:
     def test_14_03_digest_put_auth(self, env: Env, httpd, nghttpx, proto):
         if not env.curl_has_feature('digest'):
             pytest.skip("curl built without digest")
-        data='0123456789'
+        data = '0123456789'
         curl = CurlClient(env=env)
         url = f'https://{env.authority_for(env.domain1, proto)}/restricted/digest/data.json'
         r = curl.http_upload(urls=[url], data=data, alpn_proto=proto, extra_args=[
@@ -77,7 +75,7 @@ class TestAuth:
     def test_14_04_digest_large_pw(self, env: Env, httpd, nghttpx, proto):
         if not env.curl_has_feature('digest'):
             pytest.skip("curl built without digest")
-        data='0123456789'
+        data = '0123456789'
         password = 'x' * 65535
         curl = CurlClient(env=env)
         url = f'https://{env.authority_for(env.domain1, proto)}/restricted/digest/data.json'
index d1bcc22273164e8759398e444d338f9c7d136d7a..d2e987f8679b682c0a2b577d17795d7bb05b4727 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -55,7 +53,7 @@ class TestTracing:
             '-v', '--trace-config', 'ids'
         ])
         r.check_response(http_status=200)
-        for line in  r.trace_lines:
+        for line in r.trace_lines:
             m = re.match(r'^\[0-[0x]] .+', line)
             if m is None:
                 assert False, f'no match: {line}'
@@ -68,7 +66,7 @@ class TestTracing:
             '-v', '--trace-config', 'ids,time'
         ])
         r.check_response(http_status=200)
-        for line in  r.trace_lines:
+        for line in r.trace_lines:
             m = re.match(r'^([0-9:.]+) \[0-[0x]] .+', line)
             if m is None:
                 assert False, f'no match: {line}'
@@ -84,7 +82,7 @@ class TestTracing:
         ])
         r.check_response(http_status=200)
         found_tcp = False
-        for line in  r.trace_lines:
+        for line in r.trace_lines:
             m = re.match(r'^([0-9:.]+) \[0-[0x]] .+', line)
             if m is None:
                 assert False, f'no match: {line}'
@@ -102,7 +100,7 @@ class TestTracing:
         ])
         r.check_response(http_status=200)
         found_tcp = False
-        for line in  r.trace_lines:
+        for line in r.trace_lines:
             m = re.match(r'^\[0-[0x]] .+', line)
             if m is None:
                 assert False, f'no match: {line}'
index 977342eb55f8772aa45a0b14c0c985acb4ff2c10..0d184931e20834654fb3ff71e4e56ea527c96862 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 4179925f42eb1161e9c43de12e568f13abbb844b..c5b5e144f3eccdb1ddd8832b07876b2a51f80d26 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -222,7 +220,7 @@ class TestSSLUse:
             ['AES256ish', ['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384'], False],
             ['CHACHA20ish', ['ECDHE-ECDSA-CHACHA20-POLY1305', 'ECDHE-RSA-CHACHA20-POLY1305'], True],
             ['AES256ish+CHACHA20ish', ['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384',
-              'ECDHE-ECDSA-CHACHA20-POLY1305', 'ECDHE-RSA-CHACHA20-POLY1305'], True],
+             'ECDHE-ECDSA-CHACHA20-POLY1305', 'ECDHE-RSA-CHACHA20-POLY1305'], True],
         ]
         ret = []
         for tls_id, tls_proto in {
@@ -521,7 +519,7 @@ class TestSSLUse:
         pytest.param("-MAC-ALL:+AEAD", "TLSv1.3", ['TLS_CHACHA20_POLY1305_SHA256'], True, id='TLSv1.3-MAC-only-AEAD'),
         pytest.param("-GROUP-ALL:+GROUP-X25519", "TLSv1.3", ['TLS_CHACHA20_POLY1305_SHA256'], True, id='TLSv1.3-group-only-X25519'),
         pytest.param("-GROUP-ALL:+GROUP-SECP192R1", "", [], False, id='group-only-SECP192R1'),
-        ])
+    ])
     def test_17_18_gnutls_priority(self, env: Env, httpd, configures_httpd, priority, tls_proto, ciphers, success):
         # to test setting cipher suites, the AES 256 ciphers are disabled in the test server
         httpd.set_extra_config('base', [
index faa31a638e7fa358db0ef27a06e9b4a02acb155e..452b422c6b06ff1c5c4c185bfb3822109ca338dc 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 4ac447d75837b237a9e1ed4691ce4c7deddf5cd5..388d3955dabefbdecea2a247c7eafd3fc71f7171 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 5ee8b5e6a99e56ffad1a99e6c7ca9bdd10f9c179..0d1bdd9ed3929730927aaf5d8e93cbd2f3d054e0 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -95,7 +93,7 @@ class WsServer:
             self.wsproc = None
             return False
 
-        self.cerr = open(self.err_file, 'w')
+        self.cerr = open(self.err_file, 'w')  # noqa: SIM115
         port_spec = {
             self.name: socket.SOCK_STREAM
         }
@@ -248,7 +246,7 @@ class TestWebsockets:
         r = curl.http_download(urls=[url], alpn_proto='http/1.1', with_stats=True,
                                extra_args=xargs)
         # The CONNECT through the proxy fails as it does not allow it
-        r.check_exit_code(7) # CURLE_COULDNT_CONNECT
+        r.check_exit_code(7)  # CURLE_COULDNT_CONNECT
         assert r.stats[0]['http_connect'] == 403, f'{r}'
 
     def test_20_11_crazy_pings(self, env: Env):
index 940952400a7ff5a52a16f8d976fb0db560d47e4f..a287cfdf8f9e6bdcf6310487f116e8eec0c6fa0e 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -70,7 +68,7 @@ class TestResolve:
         run_env = os.environ.copy()
         run_env['CURL_DBG_RESOLV_FAIL_DELAY'] = f'{delay_ms}'
         curl = CurlClient(env=env, run_env=run_env, force_resolv=False)
-        urls = [ f'https://test-{i}.http.curl.invalid/' for i in range(count)]
+        urls = [f'https://test-{i}.http.curl.invalid/' for i in range(count)]
         r = curl.http_download(urls=urls, with_stats=True)
         r.check_exit_code(6)
         r.check_stats(count=count, http_status=0, exitcode=6)
@@ -82,7 +80,7 @@ class TestResolve:
         run_env = os.environ.copy()
         run_env['CURL_DBG_RESOLV_FAIL_DELAY'] = f'{delay_ms}'
         curl = CurlClient(env=env, run_env=run_env, force_resolv=False)
-        urls = [ f'https://test-{i}.http.curl.invalid/' for i in range(count)]
+        urls = [f'https://test-{i}.http.curl.invalid/' for i in range(count)]
         r = curl.http_download(urls=urls, with_stats=True, extra_args=[
             '--parallel'
         ])
@@ -118,7 +116,7 @@ class TestResolve:
         run_env['CURL_DBG_RESOLV_FAIL_DELAY'] = f'{delay_ms}'
         run_env['CURL_DBG_RESOLV_MAX_THREADS'] = '1'
         curl = CurlClient(env=env, run_env=run_env, force_resolv=False)
-        urls = [ f'https://test-{i}.http.curl.invalid/' for i in range(count)]
+        urls = [f'https://test-{i}.http.curl.invalid/' for i in range(count)]
         r = curl.http_download(urls=urls, with_stats=True, extra_args=[
             '--parallel', '-6'
         ])
@@ -301,11 +299,13 @@ class TestResolve:
         ])
         # should fail with CURLE_OPERATION_TIMEOUT or COULDNT_CONNECT
         assert r.exit_code in (7, 28), f'{r.dump_logs()}'
-        af_unspec_resolves = [line for line in r.trace_lines if
-            re.match(r'.* \[DNS] re-queueing query .+ for AF_UNSPEC resolve', line)]
+        af_unspec_resolves = [
+            line for line in r.trace_lines
+            if re.match(r'.* \[DNS] re-queueing query .+ for AF_UNSPEC resolve', line)
+        ]
         assert len(af_unspec_resolves) == 1, f'{r.dump_logs()}'
         aaaa_resolves = [line for line in r.trace_lines if
-            re.match(r'.* \* IPv6: fe80::1', line)]
+                         re.match(r'.* \* IPv6: fe80::1', line)]
         assert len(aaaa_resolves) == 1, f'{r.dump_logs()}'
 
     def _clean_files(self, files):
index 0b95472aa725d1be84c212704e4d18962c67ab4b..6ae5d0c72825a080d0267c36c9745badc5d08a04 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 6627be2613b7b9448227b90d19e15e68ec20ac42..860c38d5d3f43f80edf27cb252d1e8cbae969839 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 1d8a897fbdfd61badcf22f0713dddfda9b2c0a20..debb8c9b5bc1d375c59603108ee6573e63eff7be 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -109,7 +107,7 @@ class TestVsFTPD:
         ['data-1k', 10, True],
         ['data-1m', 5, True],
         ['data-1m', 5, False],
-        ['data-10m', 2,True]
+        ['data-10m', 2, True]
     ])
     def test_31_03_download_10_serial(self, env: Env, vsftpds: VsFTPD, docname, count, secure):
         curl = CurlClient(env=env)
@@ -128,7 +126,7 @@ class TestVsFTPD:
         ['data-1k', 10, True],
         ['data-1m', 5, True],
         ['data-1m', 5, False],
-        ['data-10m', 2,True]
+        ['data-10m', 2, True]
     ])
     def test_31_04_download_10_parallel(self, env: Env, vsftpds: VsFTPD, docname, count, secure):
         curl = CurlClient(env=env)
index 1e2e9652927e178d69ad0d155d5d867aa3094a3e..6db7fb1eaa0ff969c862ff5a580ebd93309ebd60 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -109,7 +107,7 @@ class TestFtpsVsFTPD:
         ['data-1k', 10, True],
         ['data-1m', 5, True],
         ['data-1m', 5, False],
-        ['data-10m', 2,True]
+        ['data-10m', 2, True]
     ])
     def test_32_03_download_10_serial(self, env: Env, vsftpds: VsFTPD, docname, count, secure):
         curl = CurlClient(env=env)
@@ -131,7 +129,7 @@ class TestFtpsVsFTPD:
         docname = 'data-1k'
         count = 2
         url1 = f'ftps://{env.ftp_domain}:{vsftpds.port}/{docname}'
-        url2 =  f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}'
+        url2 = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}'
         r = curl.ftp_get(urls=[url1, url2], with_stats=True)
         r.check_stats(count=count, http_status=226)
         assert r.total_connects == count + 1, 'should reuse the control conn'
index f4ae322f7321aa53107127d3a8e1b34a19a83b4c..186b75e43072a297930629498ac92e355c5fc6f5 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 831ee5b3f80ebf9d4ba4e2d13cb1dbe9ef067ae6..13c36acd657158ab62a78b420274c3c0c6eede50 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index acf76ef68356a91e9edbe871b785828859fa9153..6caaad9d25ba9008c94012e274cd3e48eaf950ff 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 29630e5b07fc314b7d21a88c89934f2d7c4ba13e..650644eb0d5aa21578fd7473929b2a5beec8e44f 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 # ***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index d2eea486faa73f5f4d53c2442a6be108c7a01c6f..834230a853bde66f12e65c8f7c7df8f13175cd40 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -23,7 +21,7 @@
 # SPDX-License-Identifier: curl
 #
 ###########################################################################
-# ruff: noqa: F401, E402
+# ruff: noqa: F401
 import pytest
 
 pytest.register_assert_rewrite("testenv.env", "testenv.curl", "testenv.caddy",
index a6c8b58c5cbd41db46588ab927b2e3a8bc4092bf..399bead7a56c4b5ab79c9cf6f8acf94b5244436c 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -113,7 +111,7 @@ class Caddy:
         args = [
             self._caddy, 'run'
         ]
-        self._error_fd = open(self._error_log, 'a')
+        self._error_fd = open(self._error_log, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, cwd=self._caddy_dir, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
index 8c25155b24e76bf4980c07800919bd84bcbb1a1b..3102e853992a157cde892a868d0e5f51c7aca0eb 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 0df19e5b427a43c6f48579945d285746ba40adc0..39fd61054dd37b93793af10caaf1cef439fa180b 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -41,7 +39,7 @@ class LocalClient:
 
     def __init__(self, name: str, env: Env, run_dir: Optional[str] = None,
                  timeout: Optional[float] = None,
-                 run_env: Optional[Dict[str,str]] = None):
+                 run_env: Optional[Dict[str, str]] = None):
         self.name = name
         self.path = os.path.join(env.build_dir, 'tests/libtest/libtests')
         self.env = env
index 8e187039ab1166f451e9a393339ce804f0766ee3..f37928471fedda5316ebd70dd71b6ef1897a0013 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -74,7 +72,7 @@ class RunProfile:
         return self._duration
 
     @property
-    def stats(self) -> Optional[Dict[str,Any]]:
+    def stats(self) -> Optional[Dict[str, Any]]:
         return self._stats
 
     def sample(self):
@@ -134,9 +132,8 @@ class PerfProfile:
             self._proc.terminate()
             self._rc = self._proc.returncode
         with open(self._file, 'w') as cout:
-            subprocess.run([
-                'sudo', 'perf', 'script'
-            ], stdout=cout, cwd=self._run_dir, shell=False, check=True)
+            subprocess.run(['sudo', 'perf', 'script'],
+                           stdout=cout, cwd=self._run_dir, shell=False, check=True)
 
     @property
     def file(self):
@@ -496,14 +493,14 @@ class ExecResult:
             for idx, x in enumerate(self.stats):
                 assert 'remote_port' in x, f'remote_port missing\n{self.dump_stat(x)}'
                 assert x['remote_port'] == remote_port, \
-                        f'status #{idx} remote_port: expected {remote_port}, '\
-                        f'got {x["remote_port"]}\n{self.dump_stat(x)}'
+                       f'status #{idx} remote_port: expected {remote_port}, '\
+                       f'got {x["remote_port"]}\n{self.dump_stat(x)}'
         if remote_ip is not None:
             for idx, x in enumerate(self.stats):
                 assert 'remote_ip' in x, f'remote_ip missing\n{self.dump_stat(x)}'
                 assert x['remote_ip'] == remote_ip, \
-                        f'status #{idx} remote_ip: expected {remote_ip}, '\
-                        f'got {x["remote_ip"]}\n{self.dump_stat(x)}'
+                       f'status #{idx} remote_ip: expected {remote_ip}, '\
+                       f'got {x["remote_ip"]}\n{self.dump_stat(x)}'
 
     def check_stat_positive(self, s, idx, key):
         assert key in s, f'stat #{idx} "{key}" missing: {s}'
@@ -602,8 +599,8 @@ class ExecResult:
         return ''.join(lines)
 
     def xfer_trace_for(self, xfer_id) -> List[str]:
-            pat = re.compile(f'^[^[]* \\[{xfer_id}-.*$')
-            return [line for line in self._stderr if pat.match(line)]
+        pat = re.compile(f'^[^[]* \\[{xfer_id}-.*$')
+        return [line for line in self._stderr if pat.match(line)]
 
 
 class CurlClient:
@@ -853,11 +850,11 @@ class CurlClient:
                          with_headers=with_headers)
 
     def ftp_get(self, urls: List[str],
-                      with_stats: bool = True,
-                      with_profile: bool = False,
-                      with_tcpdump: bool = False,
-                      no_save: bool = False,
-                      extra_args: Optional[List[str]] = None):
+                with_stats: bool = True,
+                with_profile: bool = False,
+                with_tcpdump: bool = False,
+                no_save: bool = False,
+                extra_args: Optional[List[str]] = None):
         if extra_args is None:
             extra_args = []
         if no_save:
@@ -882,11 +879,11 @@ class CurlClient:
                          with_tcpdump=with_tcpdump)
 
     def ftp_ssl_get(self, urls: List[str],
-                      with_stats: bool = True,
-                      with_profile: bool = False,
-                      with_tcpdump: bool = False,
-                      no_save: bool = False,
-                      extra_args: Optional[List[str]] = None):
+                    with_stats: bool = True,
+                    with_profile: bool = False,
+                    with_tcpdump: bool = False,
+                    no_save: bool = False,
+                    extra_args: Optional[List[str]] = None):
         if extra_args is None:
             extra_args = []
         extra_args.extend([
@@ -1164,7 +1161,7 @@ class CurlClient:
             elif insecure:
                 args.append('--insecure')
             elif active_options and ("--cacert" in active_options or
-                    "--capath" in active_options):
+                                     "--capath" in active_options):
                 pass
             elif u.hostname:
                 args.extend(["--cacert", self.env.ca.cert_file])
@@ -1246,9 +1243,8 @@ class CurlClient:
         stacks_collapsed = f'{perf.file}.collapsed'
         log.info(f'collapsing stacks into {stacks_collapsed}')
         with open(stacks_collapsed, 'w') as cout, open(file_err, 'w') as cerr:
-            subprocess.run([
-                fg_collapse, perf.file
-            ], stdout=cout, stderr=cerr, cwd=self._run_dir, shell=False, check=True)
+            subprocess.run([fg_collapse, perf.file],
+                           stdout=cout, stderr=cerr, cwd=self._run_dir, shell=False, check=True)
         return stacks_collapsed
 
     def _dtrace_collapse(self, dtrace: DTraceProfile, file_err):
@@ -1260,9 +1256,8 @@ class CurlClient:
         stacks_collapsed = f'{dtrace.file}.collapsed'
         log.info(f'collapsing stacks into {stacks_collapsed}')
         with open(stacks_collapsed, 'w') as cout, open(file_err, 'a') as cerr:
-            subprocess.run([
-                fg_collapse, dtrace.file
-            ], stdout=cout, stderr=cerr, cwd=self._run_dir, shell=False, check=True)
+            subprocess.run([fg_collapse, dtrace.file],
+                           stdout=cout, stderr=cerr, cwd=self._run_dir, shell=False, check=True)
         return stacks_collapsed
 
     def _generate_flame(self, curl_args: List[str],
@@ -1293,11 +1288,9 @@ class CurlClient:
             title = cmdline
             subtitle = ''
         with open(file_svg, 'w') as cout, open(file_err, 'a') as cerr:
-            subprocess.run([
-                fg_gen_flame, '--colors', 'green',
-                '--title', title, '--subtitle', subtitle,
-                stacks_collapsed
-            ], stdout=cout, stderr=cerr, cwd=self._run_dir, shell=False, check=True)
+            subprocess.run([fg_gen_flame, '--colors', 'green', '--title', title, '--subtitle',
+                            subtitle, stacks_collapsed],
+                           stdout=cout, stderr=cerr, cwd=self._run_dir, shell=False, check=True)
 
     def mk_altsvc_file(self, name, src_alpn, src_host, src_port,
                        dest_alpn, dest_host, dest_port):
index b2ea4dd0cfe4733b254be1423892e009e493881d..43b058e196e7a67a40e7c9cc7106390f66a05fef 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -128,7 +126,7 @@ class Dante:
             '-p', f'{self._pid_file}',
             '-d', '0',
         ]
-        self._error_fd = open(self._error_log, 'a')
+        self._error_fd = open(self._error_log, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
@@ -137,8 +135,8 @@ class Dante:
     def wait_live(self, timeout: timedelta):
         curl = CurlClient(env=self.env, run_dir=self._tmp_dir,
                           timeout=timeout.total_seconds(), socks_args=[
-            '--socks5', f'127.0.0.1:{self._port}'
-        ])
+                              '--socks5', f'127.0.0.1:{self._port}'
+                          ])
         try_until = datetime.now() + timeout
         while datetime.now() < try_until:
             r = curl.http_get(url=f'http://{self.env.domain1}:{self.env.http_port}/')
index 8f6bb3edc801315010a023f4166464c2c3ac95e0..18cfafcc3831a6a77ec990e301497ba4b29546a8 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -128,7 +126,7 @@ class Dnsd:
             '--logfile', f'{self._log_file}',
             '--pidfile', f'{self._pid_file}',
         ]
-        self._error_fd = open(self._error_log, 'a')
+        self._error_fd = open(self._error_log, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
index 5acb3ab67a58b37d3e5168753952d3b91ec89113..24c2276c1ef714b6dbfee54d2d727296980dc8b4 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 # ***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -513,8 +511,8 @@ class Env:
     def curl_version_at_least(min_version) -> bool:
         version = Env.curl_version()
         return Env.CONFIG.versiontuple(min_version) <= Env.CONFIG.versiontuple(
-                version
-            )
+            version
+        )
 
     @staticmethod
     def curl_features_string() -> str:
@@ -537,7 +535,7 @@ class Env:
         prefix = f"{libname.lower()}/"
         for lversion in Env.CONFIG.curl_props["lib_versions"]:
             if lversion.startswith(prefix):
-                return lversion[len(prefix) :]
+                return lversion[len(prefix):]
         return "unknown"
 
     @staticmethod
@@ -914,14 +912,14 @@ class Env:
         fpath = os.path.join(indir, fname)
         s10 = "0123456789"
         s = round((line_length / 10) + 1) * s10
-        s = s[0 : line_length - 11]
+        s = s[0:line_length - 11]
         with open(fpath, "w") as fd:
             for i in range(int(fsize / line_length)):
                 fd.write(f"{i:09d}-{s}\n")
             remain = int(fsize % line_length)
             if remain != 0:
                 i = int(fsize / line_length) + 1
-                fd.write(f"{i:09d}-{s}"[0 : remain - 1] + "\n")
+                fd.write(f"{i:09d}-{s}"[0:remain - 1] + "\n")
         return fpath
 
     def make_data_gzipbomb(self, indir: str, fname: str, fsize: int) -> str:
index deb3608d3a8cccd9cde962cac74c9100960dd359..e6241c2b4bfe483fad3dbb15f297cf0bb4aa09aa 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 # ***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -133,7 +131,7 @@ class H2o:
         self._loaded_cred_name = self._cred_name
         self.write_config()
         args = [self._cmd, "-c", self._conf_file]
-        self._error_fd = open(self._stderr, "a")
+        self._error_fd = open(self._stderr, "a")  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
index 10ccce0c4a751c98338d504a6ce1f23b505df3ce..c2a0a22b8fa3c110f1ff3240c9c41e11c90755b3 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -583,9 +581,8 @@ class Httpd:
         if not os.path.exists(out_source) or \
                 os.stat(in_source).st_mtime > os.stat(out_source).st_mtime:
             shutil.copy(in_source, out_source)
-        p = subprocess.run([
-            self.env.apxs, '-c', out_source
-        ], capture_output=True, cwd=out_dir, check=False)
+        p = subprocess.run([self.env.apxs, '-c', out_source],
+                           capture_output=True, cwd=out_dir, check=False)
         rv = p.returncode
         if rv != 0:
             log.error(f"compiling mod_curltest failed: {p.stderr}")
index 37c72ad9451fa349f56dd4f77d8cd4f60671f408..3caa99dcca1ff4ff83d87cc893058f97d87dda4d 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -270,7 +268,7 @@ class NghttpxQuic(Nghttpx):
             '--frontend-http3-max-connection-window-size=100M',
             # f'--frontend-quic-debug-log',
         ])
-        self._error_fd = open(self._stderr, 'a')
+        self._error_fd = open(self._stderr, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
@@ -320,7 +318,7 @@ class NghttpxFwd(Nghttpx):
             creds.pkey_file,
             creds.cert_file,
         ]
-        self._error_fd = open(self._stderr, 'a')
+        self._error_fd = open(self._stderr, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
index 10accb2f3b736e7cc5ba25bce9ae4845cfc6efc7..2436d407677685ccd3d3e27384f2b03252ea0dbb 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index 49c39ce494df473f35c49f9456ee780ab8547667..57c7d1e34a05ba68fc7cfe34a53cb1a3a6e0bd0c 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -235,7 +233,7 @@ class Sshd:
         run_env = os.environ.copy()
         # does not have any effect, sadly
         # run_env['HOME'] = f'{self._home_dir}'
-        self._error_fd = open(self._sshd_log, 'a')
+        self._error_fd = open(self._sshd_log, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd, env=run_env)
         if self._process.returncode is not None:
             return False
index e2c33edee33babf5a6e0d29686c5a61714b8e633..7cd9596b1640d51a38b33bd61f9a9e8e908d62b8 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
@@ -146,7 +144,7 @@ class VsFTPD:
             self._cmd,
             f'{self._conf_file}',
         ]
-        self._error_fd = open(self._error_log, 'a')
+        self._error_fd = open(self._error_log, 'a')  # noqa: SIM115
         self._process = subprocess.Popen(args=args, stderr=self._error_fd)
         if self._process.returncode is not None:
             return False
index 8d5655aa5cbd9f9063d9a7514b230e2cd38beafa..42d6e9dc2995dfb709f9bf3f2dea3a05a01bcd3c 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index fddd26f271954d9bebede6de4dbad4c724f92f91..a063b030799c4d884a880a3e314a6c0bcde76fed 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #***************************************************************************
 #                                  _   _ ____  _
 #  Project                     ___| | | |  _ \| |
index a65b156630c5bcfbb887e7de6302ddf1a4a70a1c..4e65b62ec46178e5d0526a36b848734e27128206 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #
 #  Project                     ___| | | |  _ \| |
 #                             / __| | | | |_) | |
index 44daefc15a11a584c9edb3303f4508b64f9c348e..6623aac708dff4ded8ed42a4f48729b43ce5003b 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #
 #  Project                     ___| | | |  _ \| |
 #                             / __| | | | |_) | |
@@ -153,8 +152,9 @@ def smbserver(options):
 
 class TestSmbServer(imp_smbserver.SMBSERVER):
     """
-    Test server for SMB which subclasses the impacket SMBSERVER and provides
-    test functionality.
+    Test server for SMB.
+
+    It subclasses the impacket SMBSERVER and provides test functionality.
     """
 
     def __init__(self,
@@ -176,9 +176,10 @@ class TestSmbServer(imp_smbserver.SMBSERVER):
 
     def create_and_x(self, conn_id, smb_server, smb_command, recv_packet):
         """
-        Our version of smbComNtCreateAndX looks for special test files and
-        fools the rest of the framework into opening them as if they were
-        normal files.
+        Our version of smbComNtCreateAndX.
+
+        It looks for special test files and fools the rest of the framework
+        into opening them as if they were normal files.
         """
         conn_data = smb_server.getConnectionData(conn_id)
 
@@ -372,9 +373,9 @@ def get_options():
     parser = argparse.ArgumentParser()
 
     parser.add_argument("--port", action="store", default=9017,
-                      type=int, help="port to listen on")
+                        type=int, help="port to listen on")
     parser.add_argument("--host", action="store", default="127.0.0.1",
-                      help="host to listen on")
+                        help="host to listen on")
     parser.add_argument("--verbose", action="store", type=int, default=0,
                         help="verbose output")
     parser.add_argument("--pidfile", action="store",
index 2921e93aa83b80f546e3bf2a5781562284cbad1c..ef212da073c1b939f72416a27bd9859d23189d9f 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python3
-# -*- coding: utf-8 -*-
 #
 #  Project                     ___| | | |  _ \| |
 #                             / __| | | | |_) | |