Skip to content

Commit 4e008fd

Browse files
committed
lint
1 parent e11f8fe commit 4e008fd

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Lib/http/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,4 +1423,4 @@ def finish_request(self, request, client_address):
14231423

14241424

14251425
if __name__ == '__main__':
1426-
_main()
1426+
_main()

Lib/test/test_httpservers.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ def setUp(self):
15471547
self.default_server = http.server.CommandLineServerClass
15481548
self.tls_cert = '-----BEGIN CERTIFICATE-----\n' + '-----END CERTIFICATE-----\n'
15491549
self.tls_key = '-----BEGIN RSA PRIVATE KEY-----\n' + '-----END RSA PRIVATE KEY-----\n'
1550-
1550+
15511551
self.tls_password = '<PASSWORD>'
15521552
tls_password_file_object = tempfile.NamedTemporaryFile(mode='w+', delete=False)
15531553
tls_password_file_object.write(self.tls_password)
@@ -1624,52 +1624,52 @@ def test_cgi_flag(self, mock_func):
16241624
self.invoke_httpd(['--cgi'])
16251625
mock_func.assert_called_once_with(HandlerClass=CGIHTTPRequestHandler, ServerClass=self.default_server,
16261626
protocol=self.default_protocol, port=self.default_port, bind=self.default_bind,
1627-
tls_cert=None, tls_key=None, tls_password=None)
1627+
tls_cert=None, tls_key=None, tls_password=None)
16281628

16291629
@mock.patch('http.server.test')
16301630
def test_tls_flag(self, mock_func):
16311631
tls_cert_options = ['--tls-cert', ]
16321632
tls_key_options = ['--tls-key', ]
16331633
tls_password_options = ['--tls-password-file', ]
16341634
# Normal: --tls-cert and --tls-key
1635-
1635+
16361636
for tls_cert_option in tls_cert_options:
16371637
for tls_key_option in tls_key_options:
16381638
self.invoke_httpd([tls_cert_option, self.tls_cert, tls_key_option, self.tls_key])
16391639
mock_func.assert_called_once_with(HandlerClass=self.default_handler, ServerClass=self.default_server,
16401640
protocol=self.default_protocol, port=self.default_port, bind=self.default_bind,
16411641
tls_cert=self.tls_cert, tls_key=self.tls_key, tls_password=None)
16421642
mock_func.reset_mock()
1643-
1643+
16441644
# Normal: --tls-cert, --tls-key and --tls-password-file
1645-
1645+
16461646
for tls_cert_option in tls_cert_options:
16471647
for tls_key_option in tls_key_options:
16481648
for tls_password_option in tls_password_options:
16491649
self.invoke_httpd([tls_cert_option, self.tls_cert, tls_key_option, self.tls_key, tls_password_option, self.tls_password_file])
1650-
1650+
16511651
mock_func.assert_called_once_with(HandlerClass=self.default_handler, ServerClass=self.default_server,
16521652
protocol=self.default_protocol, port=self.default_port, bind=self.default_bind,
16531653
tls_cert=self.tls_cert, tls_key=self.tls_key, tls_password=self.tls_password)
16541654
mock_func.reset_mock()
1655-
1655+
16561656
# Abnormal: --tls-key without --tls-cert
1657-
1657+
16581658
for tls_key_option in tls_key_options:
16591659
for tls_cert_option in tls_cert_options:
16601660
with self.assertRaises(SystemExit):
16611661
self.invoke_httpd([tls_key_option, self.tls_key])
16621662
mock_func.reset_mock()
1663-
1663+
16641664
# Abnormal: --tls-password-file without --tls-cert
1665-
1665+
16661666
for tls_password_option in tls_password_options:
16671667
with self.assertRaises(SystemExit):
16681668
self.invoke_httpd([tls_password_option, self.tls_password_file])
16691669
mock_func.reset_mock()
1670-
1670+
16711671
# Abnormal: --tls-password-file cannot be opened
1672-
1672+
16731673
non_existent_file = os.path.join(tempfile.gettempdir(), os.urandom(16).hex())
16741674
retry_count = 0
16751675
while os.path.exists(non_existent_file) and retry_count < 10:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add tests for the command line interface of the ``http.server`` module.
1+
Add tests for the command line interface of the ``http.server`` module.

0 commit comments

Comments
 (0)