diff options
| author | Astounds <kirito@disroot.org> | 2026-04-25 01:02:17 -0500 |
|---|---|---|
| committer | Astounds <kirito@disroot.org> | 2026-04-25 01:02:17 -0500 |
| commit | 50ad959a8051fec95f26b573f9fe067bdf3fdf6a (patch) | |
| tree | 4d94f63cf9adb951d4200b0f2bb0c762d45297c4 /tests/test_shorts.py | |
| parent | a0f315be51ef121618e73d5b450c8616c0d11d21 (diff) | |
| download | yt-local-50ad959a8051fec95f26b573f9fe067bdf3fdf6a.tar.lz yt-local-50ad959a8051fec95f26b573f9fe067bdf3fdf6a.tar.xz yt-local-50ad959a8051fec95f26b573f9fe067bdf3fdf6a.zip | |
refactor: replace string concatenations with f-strings
Diffstat (limited to 'tests/test_shorts.py')
| -rw-r--r-- | tests/test_shorts.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_shorts.py b/tests/test_shorts.py index c5b7301..c413a8b 100644 --- a/tests/test_shorts.py +++ b/tests/test_shorts.py @@ -27,7 +27,7 @@ class TestChannelCtokenV5: def _decode_outer(self, ctoken): """Decode the outer protobuf layer of a ctoken.""" - raw = base64.urlsafe_b64decode(ctoken + '==') + raw = base64.urlsafe_b64decode(f'{ctoken}==') return {fn: val for _, fn, val in proto.read_protobuf(raw)} def test_shorts_token_generates_without_error(self): @@ -68,8 +68,8 @@ class TestChannelCtokenV5: assert t_with_shorts != t_without_shorts # Decode and verify the filter is present - raw_with_shorts = base64.urlsafe_b64decode(t_with_shorts + '==') - raw_without_shorts = base64.urlsafe_b64decode(t_without_shorts + '==') + raw_with_shorts = base64.urlsafe_b64decode(f'{t_with_shorts}==') + raw_without_shorts = base64.urlsafe_b64decode(f'{t_without_shorts}==') # Parse the outer protobuf structure import youtube.proto as proto @@ -95,8 +95,8 @@ class TestChannelCtokenV5: decoded_without = urllib.parse.unquote(encoded_inner_without.decode('ascii')) # Decode the base64 data - decoded_with_bytes = base64.urlsafe_b64decode(decoded_with + '==') - decoded_without_bytes = base64.urlsafe_b64decode(decoded_without + '==') + decoded_with_bytes = base64.urlsafe_b64decode(f'{decoded_with}==') + decoded_without_bytes = base64.urlsafe_b64decode(f'{decoded_without}==') # Parse the decoded protobuf data fields_with = list(proto.read_protobuf(decoded_with_bytes)) |
