diff --git a/tests/test_checksum.py b/tests/test_checksum.py index 0f71e4c60500b2eca6301305fc57654d23f418c8..add5e74e967afa52d957c6b37e8f884eb0fed087 100644 --- a/tests/test_checksum.py +++ b/tests/test_checksum.py @@ -21,7 +21,7 @@ from silkaj.cli import cli pubkey = "3rp7ahDGeXqffBQTnENiXEFXYS7BRjYmS33NbgfCuDc8" checksum = "DFQ" -pubkey_checksum = pubkey + ":" + checksum +pubkey_checksum = f"{pubkey}:{checksum}" pubkey_seedhex_authfile = ( "3bc6f2484e441e40562155235cdbd8ce04c25e7df35bf5f87c067bf239db8511" ) @@ -31,7 +31,7 @@ pubkey_seedhex_authfile = ( "command, excepted_output", [ (["checksum", pubkey_checksum], "The checksum is valid"), - (["checksum", pubkey + ":vAK"], "The checksum is invalid"), + (["checksum", f"{pubkey}:vAK"], "The checksum is invalid"), (["checksum", pubkey], pubkey_checksum), (["checksum", "uid"], "Error: Wrong public key format"), (["checksum"], MESSAGE), @@ -44,4 +44,4 @@ def test_checksum_command(command, excepted_output): with open("authfile", "w") as f: f.write(pubkey_seedhex_authfile) result = CliRunner().invoke(cli, args=command) - assert result.output == excepted_output + "\n" + assert result.output == f"{excepted_output}\n" diff --git a/tests/test_crypto_tools.py b/tests/test_crypto_tools.py index e2247f5d6d50863ca8403bbc42a09b9740bb572c..299175bd3599119539a165361662773bbf5b2d63 100644 --- a/tests/test_crypto_tools.py +++ b/tests/test_crypto_tools.py @@ -42,7 +42,7 @@ def test_gen_checksum(pubkey, checksum): ], ) def test_validate_checksum(pubkey, checksum, expected, capsys): - pubkey_with_ck = str(pubkey + ":" + checksum) + pubkey_with_ck = f"{pubkey}:{checksum}" if expected == None: assert pubkey == crypto_tools.validate_checksum(pubkey_with_ck) else: diff --git a/tests/test_tui.py b/tests/test_tui.py index 972bfa602b4918abeb69b2747e55af7a2edbf4b4..9ac6faaa7881404ccd70101195d0523475224f69 100644 --- a/tests/test_tui.py +++ b/tests/test_tui.py @@ -30,14 +30,8 @@ def test_display_amount(message, amount, currency_symbol): amount_UD = round(amount / mock_ud_value, 2) expected = [ [ - message + " (unit|relative)", - str(amount / 100) - + " " - + currency_symbol - + " | " - + str(amount_UD) - + " UD " - + currency_symbol, + f"{message} (unit|relative)", + f"{str(amount / 100)} {currency_symbol} | {str(amount_UD)} UD {currency_symbol}", ] ] tx = list() @@ -56,9 +50,9 @@ def test_display_amount(message, amount, currency_symbol): def test_display_pubkey(message, pubkey, id, monkeypatch): monkeypatch.setattr(wot_tools, "is_member", patched_is_member) - expected = [[message + " (pubkey:checksum)", display_pubkey_and_checksum(pubkey)]] + expected = [[f"{message} (pubkey:checksum)", display_pubkey_and_checksum(pubkey)]] if id: - expected.append([message + " (id)", id]) + expected.append([f"{message} (id)", id]) tx = list() display_pubkey(tx, message, pubkey) assert tx == expected diff --git a/tests/test_verify_blocks.py b/tests/test_verify_blocks.py index af48140db616c1cff8937da19f688fe3f7ab1e89..16396ca3b4daa62ca8682dcc42040cd28eed6cc2 100644 --- a/tests/test_verify_blocks.py +++ b/tests/test_verify_blocks.py @@ -55,8 +55,8 @@ def test_check_passed_blocks_range(from_block, to_block, capsys, monkeypatch): assert pytest_wrapped_e.value.code == FAILURE_EXIT_STATUS captured = capsys.readouterr() if to_block == HEAD_BLOCK + 1: - expected = "Passed TO_BLOCK argument is bigger than the head block: " + str( - HEAD_BLOCK + expected = ( + f"Passed TO_BLOCK argument is bigger than the head block: {str(HEAD_BLOCK)}" ) else: expected = "TO_BLOCK should be bigger or equal to FROM_BLOCK\n"