correct sim test to `x in a and y in a` (#15554)

This commit is contained in:
Kyle Altendorf 2023-06-29 21:48:06 -04:00 committed by GitHub
parent fda9db97ed
commit e2a5f8d7da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 5 deletions

View File

@ -85,9 +85,14 @@ def _test_sim_status(runner: CliRunner, address: str, simulator_name: str) -> No
result: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "status", "--show-key", "-cia"])
assert result.exit_code == 0
# asserts are grouped by arg
assert f"Fingerprint: {fingerprint}" and f"Mnemonic seed (24 secret words):\n{mnemonic}" in result.output # -k
assert (
f"Fingerprint: {fingerprint}" in result.output
and f"Mnemonic seed (24 secret words):\n{mnemonic}" in result.output
) # -k
assert "Network: simulator0" and "Current Blockchain Status: Full Node Synced" in result.output # default
assert (
"Network: simulator0" in result.output and "Current Blockchain Status: Full Node Synced" in result.output
) # default
assert "Height: 1" in result.output # default
assert f"Current Farming address: {address}, with a balance of: 21000000.0 TXCH." in result.output # default
@ -114,7 +119,7 @@ def _test_farm_and_revert_block(runner: CliRunner, address: str, simulator_name:
# do a reorg, 3 blocks back, 2 blocks forward, height now 8
reorg_result: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "revert", "-b", "3", "-n", "2"])
assert reorg_result.exit_code == 0
assert "Block: 3 and above " and "Block Height is now: 8" in reorg_result.output
assert "Block: 3 and above " in reorg_result.output and "Block Height is now: 8" in reorg_result.output
# check that height changed by 2
reorg_check: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "status"])
@ -124,7 +129,10 @@ def _test_farm_and_revert_block(runner: CliRunner, address: str, simulator_name:
# do a forceful reorg 4 blocks back
forced_reorg_result: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "revert", "-b", "4", "-fd"])
assert forced_reorg_result.exit_code == 0
assert "Block: 8 and above were successfully deleted" and "Block Height is now: 4" in forced_reorg_result.output
assert (
"Block: 8 and above were successfully deleted" in forced_reorg_result.output
and "Block Height is now: 4" in forced_reorg_result.output
)
# check that height changed by 4
forced_reorg_check: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "status"])
@ -134,7 +142,10 @@ def _test_farm_and_revert_block(runner: CliRunner, address: str, simulator_name:
# test chain reset to genesis
genesis_reset_result: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "revert", "-fd", "--reset"])
assert genesis_reset_result.exit_code == 0
assert "Block: 2 and above were successfully deleted" and "Block Height is now: 1" in genesis_reset_result.output
assert (
"Block: 2 and above were successfully deleted" in genesis_reset_result.output
and "Block Height is now: 1" in genesis_reset_result.output
)
# check that height changed to 1
genesis_reset_check: Result = runner.invoke(cli, ["dev", "sim", "-n", simulator_name, "status"])