diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2024-01-15 15:48:58 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2024-01-15 15:48:58 +0000 |
commit | 5a8337933df1cf3aba967d86549e236dd9173386 (patch) | |
tree | 30842acf799fc521702b1c4b070332c72feaaa1c /test/test_tls_sni.py | |
parent | e95a91cbfac018b9877d9e389e614e9f2a9f1313 (diff) | |
download | unit-5a8337933df1cf3aba967d86549e236dd9173386.tar.gz unit-5a8337933df1cf3aba967d86549e236dd9173386.tar.bz2 |
Tests: pathlib used where appropriate
Also fixed various pylint errors and style issues.
Diffstat (limited to '')
-rw-r--r-- | test/test_tls_sni.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_tls_sni.py b/test/test_tls_sni.py index aa7ed3c5..61d72125 100644 --- a/test/test_tls_sni.py +++ b/test/test_tls_sni.py @@ -2,6 +2,7 @@ import ssl import subprocess import pytest + from unit.applications.tls import ApplicationTLS from unit.option import option @@ -104,7 +105,7 @@ def config_bundles(bundles): def generate_ca_conf(): - with open(f'{option.temp_dir}/ca.conf', 'w') as f: + with open(f'{option.temp_dir}/ca.conf', 'w', encoding='utf-8') as f: f.write( f"""[ ca ] default_ca = myca @@ -126,10 +127,10 @@ commonName = optional basicConstraints = critical,CA:TRUE""" ) - with open(f'{option.temp_dir}/certserial', 'w') as f: + with open(f'{option.temp_dir}/certserial', 'w', encoding='utf-8') as f: f.write('1000') - with open(f'{option.temp_dir}/certindex', 'w') as f: + with open(f'{option.temp_dir}/certindex', 'w', encoding='utf-8') as f: f.write('') |