Marco Ricci commited on 2024-12-21 00:57:49
Zeige 8 geänderte Dateien mit 45 Einfügungen und 37 Löschungen.
Aside from formatting fixes, disable the E501/line-too-long and C419/unnecessary-comprehension-in-call linting rules in tests, where they hinder debuggability of the tests. (See embedded comments for full rationale.) Furthermore, make `coverage` recognize `@overload` lines automatically as lines that should not be included in coverage, like `assert False` and friends.
... | ... |
@@ -81,6 +81,7 @@ exclude_also = [ |
81 | 81 |
"raise NotImplementedError", |
82 | 82 |
'assert False', |
83 | 83 |
'(?:typing\.)?assert_never\(', |
84 |
+ '@overload', |
|
84 | 85 |
] |
85 | 86 |
|
86 | 87 |
[tool.coverage.run] |
... | ... |
@@ -304,6 +305,15 @@ select = [ |
304 | 305 |
# things), we need to call and to mock several internal functions, |
305 | 306 |
# which would automatically trigger `SLF001`. |
306 | 307 |
'SLF001', |
308 |
+ # pytest does not support sensible introspection of `assert all(...)` |
|
309 |
+ # expressions in tests the same way it supports introspection in |
|
310 |
+ # `asssert all([...])`. So the extra list comprehension actually |
|
311 |
+ # improves debuggability in this case. |
|
312 |
+ 'C419', |
|
313 |
+ # The tests sometimes include long strings (in non-Python formats) |
|
314 |
+ # that should be included verbatim, without artificial line breaking, |
|
315 |
+ # so they can be grepped for. |
|
316 |
+ 'E501', |
|
307 | 317 |
] |
308 | 318 |
|
309 | 319 |
[tool.ruff.lint.flake8-copyright] |
... | ... |
@@ -225,8 +225,7 @@ def validate_vault_config( |
225 | 225 |
*, |
226 | 226 |
allow_derivepassphrase_extensions: bool, |
227 | 227 |
allow_unknown_settings: bool = False, |
228 |
-) -> None: |
|
229 |
- ... # pragma: no cover |
|
228 |
+) -> None: ... |
|
230 | 229 |
|
231 | 230 |
|
232 | 231 |
@overload |
... | ... |
@@ -235,8 +234,7 @@ def validate_vault_config( |
235 | 234 |
/, |
236 | 235 |
*, |
237 | 236 |
allow_unknown_settings: bool = False, |
238 |
-) -> None: |
|
239 |
- ... # pragma: no cover |
|
237 |
+) -> None: ... |
|
240 | 238 |
|
241 | 239 |
|
242 | 240 |
def validate_vault_config( # noqa: C901,PLR0912 |
... | ... |
@@ -2374,9 +2376,11 @@ def derivepassphrase_vault( # noqa: C901,PLR0912,PLR0913,PLR0914,PLR0915 |
2374 | 2376 |
# cases, set the phrase via vault.Vault.phrase_from_key if |
2375 | 2377 |
# a key is given. Finally, if nothing is set, error out. |
2376 | 2378 |
if use_key or use_phrase: |
2377 |
- kwargs['phrase'] = _key_to_phrase( |
|
2378 |
- key, error_callback=err |
|
2379 |
- ) if use_key else phrase |
|
2379 |
+ kwargs['phrase'] = ( |
|
2380 |
+ _key_to_phrase(key, error_callback=err) |
|
2381 |
+ if use_key |
|
2382 |
+ else phrase |
|
2383 |
+ ) |
|
2380 | 2384 |
elif kwargs.get('key'): |
2381 | 2385 |
kwargs['phrase'] = _key_to_phrase( |
2382 | 2386 |
kwargs['key'], error_callback=err |
... | ... |
@@ -379,7 +379,7 @@ class SSHAgentClient: |
379 | 379 |
) |
380 | 380 |
|
381 | 381 |
@overload |
382 |
- def request( # pragma: no cover |
|
382 |
+ def request( |
|
383 | 383 |
self, |
384 | 384 |
code: int | _types.SSH_AGENTC, |
385 | 385 |
payload: Buffer, |
... | ... |
@@ -389,7 +389,7 @@ class SSHAgentClient: |
389 | 389 |
) -> tuple[int, bytes]: ... |
390 | 390 |
|
391 | 391 |
@overload |
392 |
- def request( # pragma: no cover |
|
392 |
+ def request( |
|
393 | 393 |
self, |
394 | 394 |
code: int | _types.SSH_AGENTC, |
395 | 395 |
payload: Buffer, |
... | ... |
@@ -401,7 +401,7 @@ class SSHAgentClient: |
401 | 401 |
) -> bytes: ... |
402 | 402 |
|
403 | 403 |
@overload |
404 |
- def request( # pragma: no cover |
|
404 |
+ def request( |
|
405 | 405 |
self, |
406 | 406 |
code: int | _types.SSH_AGENTC, |
407 | 407 |
payload: Buffer, |
... | ... |
@@ -487,7 +487,7 @@ idwcakUGCekJD/vCEml2AAAAG3Rlc3Qga2V5IHdpdGhvdXQgcGFzc3BocmFzZQEC |
487 | 487 |
68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
488 | 488 |
"""), |
489 | 489 |
'public_key': rb"""ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIF4gWgm1gJIXw//Mkhv5MEwidwcakUGCekJD/vCEml2 test key without passphrase |
490 |
-""", # noqa: E501 |
|
490 |
+""", |
|
491 | 491 |
'public_key_data': bytes.fromhex(""" |
492 | 492 |
00 00 00 0b 73 73 68 2d 65 64 32 35 35 31 39 |
493 | 493 |
00 00 00 20 |
... | ... |
@@ -502,7 +502,7 @@ idwcakUGCekJD/vCEml2AAAAG3Rlc3Qga2V5IHdpdGhvdXQgcGFzc3BocmFzZQEC |
502 | 502 |
0d 08 1f ec f8 73 9b 8c 5f 55 39 16 7c 53 54 2c |
503 | 503 |
1e 52 bb 30 ed 7f 89 e2 2f 69 51 55 d8 9e a6 02 |
504 | 504 |
"""), |
505 |
- 'derived_passphrase': rb'8JgZgGwal9UmA27M42WPhmYHExkTCSEzM/nkNlMdr/0NCB/s+HObjF9VORZ8U1QsHlK7MO1/ieIvaVFV2J6mAg==', # noqa: E501 |
|
505 |
+ 'derived_passphrase': rb'8JgZgGwal9UmA27M42WPhmYHExkTCSEzM/nkNlMdr/0NCB/s+HObjF9VORZ8U1QsHlK7MO1/ieIvaVFV2J6mAg==', |
|
506 | 506 |
}, |
507 | 507 |
# Currently only supported by PuTTY (which is deficient in other |
508 | 508 |
# niceties of the SSH agent and the agent's client). |
... | ... |
@@ -536,7 +536,7 @@ dGhvdXQgcGFzc3BocmFzZQECAwQFBgcICQ== |
536 | 536 |
74 68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
537 | 537 |
"""), |
538 | 538 |
'public_key': rb"""ssh-ed448 AAAACXNzaC1lZDQ0OAAAADni9nLTT1a7zATGO8RveGq0vPUY7/53m+YZRsStZDgBQ72ZgtPMckdzabiz7JbM/b0JzcRzGLMsbwA= test key without passphrase |
539 |
-""", # noqa: E501 |
|
539 |
+""", |
|
540 | 540 |
'public_key_data': bytes.fromhex(""" |
541 | 541 |
00 00 00 09 73 73 68 2d 65 64 34 34 38 |
542 | 542 |
00 00 00 39 e2 f6 72 d3 4f 56 bb cc 04 |
... | ... |
@@ -555,7 +555,7 @@ dGhvdXQgcGFzc3BocmFzZQECAwQFBgcICQ== |
555 | 555 |
db bd 77 7c 80 20 7f 3a 48 61 f6 1f ae a9 5e 53 |
556 | 556 |
7b e0 9d 93 1e ea dc eb b5 cd 56 4c ea 8f 08 00 |
557 | 557 |
"""), |
558 |
- 'derived_passphrase': rb'Bob0ZKSmutnDIsSTSZn8Ed5nlwjy2Lc8LBPnxRwekqYO2C9tgQOCAONy5DJtctJtMoQ/zKkeVywAmrOZ3kXazi7R2+WJ8zW+JFiQxsoE8NuIgNu9d3yAIH86SGH2H66pXlN74J2THurc67XNVkzqjwgA', # noqa: E501 |
|
558 |
+ 'derived_passphrase': rb'Bob0ZKSmutnDIsSTSZn8Ed5nlwjy2Lc8LBPnxRwekqYO2C9tgQOCAONy5DJtctJtMoQ/zKkeVywAmrOZ3kXazi7R2+WJ8zW+JFiQxsoE8NuIgNu9d3yAIH86SGH2H66pXlN74J2THurc67XNVkzqjwgA', |
|
559 | 559 |
}, |
560 | 560 |
'rsa': { |
561 | 561 |
'private_key': rb"""-----BEGIN OPENSSH PRIVATE KEY----- |
... | ... |
@@ -693,7 +693,7 @@ Bgp6142WnSCQAAABt0ZXN0IGtleSB3aXRob3V0IHBhc3NwaHJhc2UB |
693 | 693 |
74 68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
694 | 694 |
"""), |
695 | 695 |
'public_key': rb"""ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxoe7pezhxWy4NI0mUwKqg9WCYOAS+IjxN9eYcqpfcmQiojcuy9XsiN/xYJ1O94SrsKS5mEia2xHnYA4RUChTyYNcM2v6cnnBQ/N/VQhpGMN7SVxdbhKUXTWFCwbjBgO6rGyHB6WtoH8vd7TOEPt+NgcXwhsWyoaUUdYTA62V+GF9vEmxMaC4ubgDz+B0QkPnauSoNxmkhcIe0lsLNb1pClZyz88PDnKXCX/d0HuN/HJ+sbPg7dCvOyqFYSyKn3uY6bCXqoIdurxXzH3O7z0P8f5sbmKOrGGKNuNxVRbeVl/D/3uDL0nqsbfUc1qvkfwbJwtMXC4IV6kOZMSk2BAsqh7x48gQ+rhYeEVSi8F3CWs4HJQoqrGt7K9a3mCSlMBHP70u3w6ME7eumoryxlUofewTd17ZEkzdX08l2ZlKzZvwQUrc+xQZ2Uw8z2mfW6Ti4gi0pYGaig7Ke4PwuXpo/C5YAWfeXycsvJZ2uaYRjMdZeJGNAnHLUGLkBscw5aI8= test key without passphrase |
696 |
-""", # noqa: E501 |
|
696 |
+""", |
|
697 | 697 |
'public_key_data': bytes.fromhex(""" |
698 | 698 |
00 00 00 07 73 73 68 2d 72 73 61 |
699 | 699 |
00 00 00 03 01 00 01 |
... | ... |
@@ -751,7 +751,7 @@ Bgp6142WnSCQAAABt0ZXN0IGtleSB3aXRob3V0IHBhc3NwaHJhc2UB |
751 | 751 |
de 69 2c 48 62 d9 fd d1 9b 6b b0 49 db d3 ff 38 |
752 | 752 |
e7 10 d9 2d ce 9f 0d 5e 09 7b 37 d2 7b c3 bf ce |
753 | 753 |
"""), |
754 |
- 'derived_passphrase': rb'ohB8Lva7U6h0KqEZma2Bvnmc7dadCU5uxRhIM5B3mWj3ngNazU4Y64l9haLurkqS9m/Ouf6GfyprMdpuGv6ipYi4RH+hdnOz7HW10Ka5FZdlCRN9lCHR+10PiyMEd8LDVSKxoAmK9Tgq1n8bhymgJdMlb8tkYQeY3BTFhPiSJF5QEWtJ5fDMKcspqRnYp3EfkQsFsQFLwl8ApbYhv/gsnWebRzsKSWt5Lfwd7Ayw5Sci1an408P530ho6fvvPNwmv8/qKUMBpuPFUZX0Zm2KVeJH7OgwRUyuR+fJpCGLZLq2iPYh+HO5yxGheHWSxlrlZP7tQtmVmeYrbzwWPCh0pHIvDT8sM2eqNRmO57URL7P3asUC4m+jQuNiGZkD6qUg56HjvMgGo7V81nZd329gRoMqCADW09mkwUGM+GBWRYHaO6IWH55OdYMX2sNTwz4ZpBu80im4eGEreOaxUrDV7N5pLEhi2f3Rm2uwSdvT/zjnENktzp8NXgl7N9J7w7/O', # noqa: E501 |
|
754 |
+ 'derived_passphrase': rb'ohB8Lva7U6h0KqEZma2Bvnmc7dadCU5uxRhIM5B3mWj3ngNazU4Y64l9haLurkqS9m/Ouf6GfyprMdpuGv6ipYi4RH+hdnOz7HW10Ka5FZdlCRN9lCHR+10PiyMEd8LDVSKxoAmK9Tgq1n8bhymgJdMlb8tkYQeY3BTFhPiSJF5QEWtJ5fDMKcspqRnYp3EfkQsFsQFLwl8ApbYhv/gsnWebRzsKSWt5Lfwd7Ayw5Sci1an408P530ho6fvvPNwmv8/qKUMBpuPFUZX0Zm2KVeJH7OgwRUyuR+fJpCGLZLq2iPYh+HO5yxGheHWSxlrlZP7tQtmVmeYrbzwWPCh0pHIvDT8sM2eqNRmO57URL7P3asUC4m+jQuNiGZkD6qUg56HjvMgGo7V81nZd329gRoMqCADW09mkwUGM+GBWRYHaO6IWH55OdYMX2sNTwz4ZpBu80im4eGEreOaxUrDV7N5pLEhi2f3Rm2uwSdvT/zjnENktzp8NXgl7N9J7w7/O', |
|
755 | 755 |
}, |
756 | 756 |
} |
757 | 757 |
|
... | ... |
@@ -816,7 +816,7 @@ u7HfrQhdOiKSa+ZO9AAojbURqrLDRfBJa5dXn2AAAAFQDJHfenj4EJ9WkehpdJatPBlqCW |
816 | 816 |
74 68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
817 | 817 |
"""), |
818 | 818 |
'public_key': rb"""ssh-dss AAAAB3NzaC1kc3MAAACBALsoBleoEY1UsFA+twxgCg1bngGEPxoiF7sENZjMlyxoy3vZUpKSC5nz5dHudFrQL9mwGL64mnR2nHL1kxM5Zfi7lg8x5BxcR0YTFkh+KYapI4CzLp8KV3Yh8lklkTFwKaF71KyOx3dhIA8lGW45cVBz3kxmhHmEzCUgMPxDOsTtAAAAFQD32c5k6B3tocxUahelQQFyfseiywAAAIAuvYCDeHEzesp3HNVTDx9fRVU9c77f4qvyEZ7Qpz/s3BVoFUvUZDx96cG5bKekBRsfTCjeHXCQH/yFfqn5Lxye7msgGVS5U3AvD9shiiEr3wt+pNgr9X6DooP7ybfjC8SJdmarLBjnifZuSxyHU2q+P+02kvMTFLH9dLSRIzVqKAAAAIBtA1E9xUS4YOsRx/7GDm2AB6M9cE9ev8myz4KGTriSbeaKsxiMBbJZi1VyBP7uE5jG1hGKfwvIwuopGaprRDlSu8N8KGAuG+wb1hJv8ynDmqbw+IdJp/CGRrP+17f7yEqiCqh7ux360IXToikmvmTvQAKI21Eaqyw0XwSWuXV59g== test key without passphrase |
819 |
-""", # noqa: E501 |
|
819 |
+""", |
|
820 | 820 |
'public_key_data': bytes.fromhex(""" |
821 | 821 |
00 00 00 07 73 73 68 2d 64 73 73 |
822 | 822 |
00 00 00 81 00 |
... | ... |
@@ -879,7 +879,7 @@ dGhvdXQgcGFzc3BocmFzZQECAwQ= |
879 | 879 |
74 68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
880 | 880 |
"""), |
881 | 881 |
'public_key': rb"""ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMttTTMPCyTYO+n5Vgiuw1V/mBbDPZLdJnxNvGJBGSmcZJWrIigck4lz41Ai0BrvGUn/xnqB/PntndqlSRowmbo= test key without passphrase |
882 |
-""", # noqa: E501 |
|
882 |
+""", |
|
883 | 883 |
'public_key_data': bytes.fromhex(""" |
884 | 884 |
00 00 00 13 65 63 64 |
885 | 885 |
73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 36 |
... | ... |
@@ -924,7 +924,7 @@ JAu0J3Q+cypZuKQVAAAAMQD5sTy8p+B1cn/DhOmXquui1BcxvASqzzevkBlbQoBa73y04B |
924 | 924 |
74 68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
925 | 925 |
"""), |
926 | 926 |
'public_key': rb"""ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBKCQ6OQC+ru/m8e6PcoEvj8QBZyfmFkPIpxvJXR4EwYWruEpdCVmohqEtWp4xHRCqaTE0nauXLZUdxed6re9n718ixYI51iTlY/c1k/O/3XVefvBsSQLtCd0PnMqWbikFQ== test key without passphrase |
927 |
-""", # noqa: E501 |
|
927 |
+""", |
|
928 | 928 |
'public_key_data': bytes.fromhex(""" |
929 | 929 |
00 00 00 13 65 63 64 |
930 | 930 |
73 61 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 |
... | ... |
@@ -976,7 +976,7 @@ Rlc3Qga2V5IHdpdGhvdXQgcGFzc3BocmFzZQ== |
976 | 976 |
74 68 6f 75 74 20 70 61 73 73 70 68 72 61 73 65 |
977 | 977 |
"""), |
978 | 978 |
'public_key': rb"""ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBABJU53APOeaVwaqIu8W1h5W2sASJXOIh+wvuMQzxS27+bxZKQ8VC2PCp0XD5Z9nSaLqoxsQWCL8QvNlIpW14JJtwwCGoCQ4wUqIO7hvG+wzptPTZG7urbJPjXJLIaFQPRDJIGcjoKS3/CdDVMSmPzMMqJESvGz17pAsYSU1GTMs8yz6Yw== test key without passphrase |
979 |
-""", # noqa: E501 |
|
979 |
+""", |
|
980 | 980 |
'public_key_data': bytes.fromhex(""" |
981 | 981 |
00 00 00 13 65 63 64 |
982 | 982 |
73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 36 |
... | ... |
@@ -1023,10 +1023,10 @@ DUMMY_PHRASE_FROM_KEY1_RAW = ( |
1023 | 1023 |
b'\x1d\xaf\xfd\r\x08\x1f\xec\xf8s\x9b\x8c_U9\x16|ST,' |
1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DQ0MDkxNGFiNmRlMGQ2YjZiNjI5NGMwN2IwMmI4MGZi' # noqa: E501 |
|
1029 |
+VAULT_V02_CONFIG = 'P7xeh5y4jmjpJ2pFq4KUcTVoaE9ZOEkwWmpVTURSSWQxbGt6emN4aFE4eFM3anVPbDRNTGpOLzY3eDF5aE1YTm5LNWh5Q1BwWTMwM3M5S083MWRWRFlmOXNqSFJNcStGMWFOS3c2emhiOUNNenZYTmNNMnZxaUErdlRoOGF2ZHdGT1ZLNTNLOVJQcU9jWmJrR3g5N09VcVBRZ0ZnSFNUQy9HdFVWWnFteVhRVkY3MHNBdnF2ZWFEbFBseWRGelE1c3BFTnVUckRQdWJSL29wNjFxd2Y2ZVpob3VyVzRod3FKTElTenJ1WTZacTJFOFBtK3BnVzh0QWVxcWtyWFdXOXYyenNQeFNZbWt1MDU2Vm1kVGtISWIxWTBpcWRFbyswUVJudVVhZkVlNVpGWDA4WUQ2Q2JTWW81SnlhQ2Zxa3cxNmZoQjJES0Uyd29rNXpSck5iWVBrVmEwOXFya1NpMi9saU5LL3F0M3N3MjZKekNCem9ER2svWkZ0SUJLdmlHRno0VlQzQ3pqZTBWcTM3YmRiNmJjTkhqUHZoQ0NxMW1ldW1XOFVVK3pQMEtUMkRMVGNvNHFlOG40ck5KcGhsYXg1b1VzZ1NYU1B2T3RXdEkwYzg4NWE3YWUzOWI1MDI0MThhMWZjODQ3MDA2OTJmNDQ0MDkxNGFiNmRlMGQ2YjZiNjI5NGMwN2IwMmI4MGZi' |
|
1030 | 1030 |
VAULT_V02_CONFIG_DATA = { |
1031 | 1031 |
'global': { |
1032 | 1032 |
'phrase': DUMMY_PASSPHRASE.rstrip('\n'), |
... | ... |
@@ -1038,7 +1038,7 @@ VAULT_V02_CONFIG_DATA = { |
1038 | 1038 |
DUMMY_SERVICE: DUMMY_CONFIG_SETTINGS.copy(), |
1039 | 1039 |
}, |
1040 | 1040 |
} |
1041 |
-VAULT_V03_CONFIG = 'sBPBrr8BFHPxSJkV/A53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1043 | 1043 |
'global': { |
1044 | 1044 |
'phrase': DUMMY_PASSPHRASE.rstrip('\n'), |
... | ... |
@@ -254,7 +254,7 @@ def running_ssh_agent( # pragma: no cover |
254 | 254 |
assert ( |
255 | 255 |
os.environ.get('SSH_AUTH_SOCK', None) |
256 | 256 |
== startup_ssh_auth_sock |
257 |
- ), f'SSH_AUTH_SOCK mismatch when checking for spawnable {exec_name}' # noqa: E501 |
|
257 |
+ ), f'SSH_AUTH_SOCK mismatch when checking for spawnable {exec_name}' |
|
258 | 258 |
proc = spawn_func(executable=shutil.which(exec_name), env={}) |
259 | 259 |
if proc is None: |
260 | 260 |
continue |
... | ... |
@@ -370,7 +370,7 @@ def spawn_ssh_agent( |
370 | 370 |
else: |
371 | 371 |
assert ( |
372 | 372 |
os.environ.get('SSH_AUTH_SOCK', None) == startup_ssh_auth_sock |
373 |
- ), f'SSH_AUTH_SOCK mismatch when checking for spawnable {exec_name}' # noqa: E501 |
|
373 |
+ ), f'SSH_AUTH_SOCK mismatch when checking for spawnable {exec_name}' |
|
374 | 374 |
proc = spawn_func( |
375 | 375 |
executable=shutil.which(exec_name), env=agent_env |
376 | 376 |
) |
... | ... |
@@ -1704,7 +1704,7 @@ contents go here |
1704 | 1704 |
}), |
1705 | 1705 |
( |
1706 | 1706 |
"Invalid value 'XXX' for config key " |
1707 |
- "vault.default-unicode-normalization-form" |
|
1707 |
+ 'vault.default-unicode-normalization-form' |
|
1708 | 1708 |
), |
1709 | 1709 |
id='global', |
1710 | 1710 |
), |
... | ... |
@@ -1722,7 +1722,7 @@ contents go here |
1722 | 1722 |
}), |
1723 | 1723 |
( |
1724 | 1724 |
"Invalid value 'XXX' for config key " |
1725 |
- "vault.with_normalization.unicode-normalization-form" |
|
1725 |
+ 'vault.with_normalization.unicode-normalization-form' |
|
1726 | 1726 |
), |
1727 | 1727 |
id='service', |
1728 | 1728 |
), |
... | ... |
@@ -1802,7 +1802,7 @@ contents go here |
1802 | 1802 |
assert result.error_exit( |
1803 | 1803 |
error=( |
1804 | 1804 |
"Invalid value 'XXX' for config key " |
1805 |
- "vault.default-unicode-normalization-form" |
|
1805 |
+ 'vault.default-unicode-normalization-form' |
|
1806 | 1806 |
), |
1807 | 1807 |
), 'expected error exit and known error message' |
1808 | 1808 |
|
... | ... |
@@ -1953,7 +1953,7 @@ Our menu: |
1953 | 1953 |
Your selection? (1-10, leave empty to abort): 9 |
1954 | 1954 |
A fine choice: Spam, spam, spam, spam, spam, spam, baked beans, spam, spam, spam and spam |
1955 | 1955 |
(Note: Vikings strictly optional.) |
1956 |
-""" # noqa: E501 |
|
1956 |
+""" |
|
1957 | 1957 |
), 'expected clean exit' |
1958 | 1958 |
_result = runner.invoke( |
1959 | 1959 |
driver, ['--heading='], input='', catch_exceptions=True |
... | ... |
@@ -1976,7 +1976,7 @@ A fine choice: Spam, spam, spam, spam, spam, spam, baked beans, spam, spam, spam |
1976 | 1976 |
[9] Spam, spam, spam, spam, spam, spam, baked beans, spam, spam, spam and spam |
1977 | 1977 |
[10] Lobster thermidor aux crevettes with a mornay sauce garnished with truffle paté, brandy and a fried egg on top and spam |
1978 | 1978 |
Your selection? (1-10, leave empty to abort):\x20 |
1979 |
-""" # noqa: E501 |
|
1979 |
+""" |
|
1980 | 1980 |
), 'expected known output' |
1981 | 1981 |
|
1982 | 1982 |
def test_112_prompt_for_selection_single(self) -> None: |
... | ... |
@@ -2515,9 +2514,7 @@ Boo. |
2515 | 2514 |
): |
2516 | 2515 |
cli._key_to_phrase(loaded_key, error_callback=err) |
2517 | 2516 |
with monkeypatch.context() as mp: |
2518 |
- mp.setenv( |
|
2519 |
- 'SSH_AUTH_SOCK', os.environ['SSH_AUTH_SOCK'] + '~' |
|
2520 |
- ) |
|
2517 |
+ mp.setenv('SSH_AUTH_SOCK', os.environ['SSH_AUTH_SOCK'] + '~') |
|
2521 | 2518 |
with pytest.raises( |
2522 | 2519 |
CustomError, match='Cannot connect to SSH agent' |
2523 | 2520 |
): |
... | ... |
@@ -3043,7 +3040,7 @@ class ConfigManagementStateMachine(stateful.RuleBasedStateMachine): |
3043 | 3040 |
_vault_full_config, |
3044 | 3041 |
min_size=4, |
3045 | 3042 |
max_size=4, |
3046 |
- ) |
|
3043 |
+ ), |
|
3047 | 3044 |
) |
3048 | 3045 |
def extract_initial_settings( |
3049 | 3046 |
self, |
... | ... |
@@ -47,17 +47,17 @@ class TestStaticFunctionality: |
47 | 47 |
['line', 'env_name', 'value'], |
48 | 48 |
[ |
49 | 49 |
( |
50 |
- 'SSH_AUTH_SOCK=/tmp/pageant.user/pageant.27170; export SSH_AUTH_SOCK;', # noqa: E501 |
|
50 |
+ 'SSH_AUTH_SOCK=/tmp/pageant.user/pageant.27170; export SSH_AUTH_SOCK;', |
|
51 | 51 |
'SSH_AUTH_SOCK', |
52 | 52 |
'/tmp/pageant.user/pageant.27170', |
53 | 53 |
), |
54 | 54 |
( |
55 |
- 'SSH_AUTH_SOCK=/tmp/ssh-3CSTC1W5M22A/agent.27270; export SSH_AUTH_SOCK;', # noqa: E501 |
|
55 |
+ 'SSH_AUTH_SOCK=/tmp/ssh-3CSTC1W5M22A/agent.27270; export SSH_AUTH_SOCK;', |
|
56 | 56 |
'SSH_AUTH_SOCK', |
57 | 57 |
'/tmp/ssh-3CSTC1W5M22A/agent.27270', |
58 | 58 |
), |
59 | 59 |
( |
60 |
- 'SSH_AUTH_SOCK=/tmp/pageant.user/pageant.27170; export SSH_AUTH_SOCK', # noqa: E501 |
|
60 |
+ 'SSH_AUTH_SOCK=/tmp/pageant.user/pageant.27170; export SSH_AUTH_SOCK', |
|
61 | 61 |
'SSH_AUTH_SOCK', |
62 | 62 |
'/tmp/pageant.user/pageant.27170', |
63 | 63 |
), |
64 | 64 |