Skip to content
Snippets Groups Projects
Commit 329896a5 authored by matograine's avatar matograine Committed by Moul
Browse files

[test] #203 change tx_history.py tests to match new behavior.

generate_table does not add table headers any more.
parent d9a4ddc6
No related branches found
No related tags found
1 merge request!199#203: Harmonize tables style using Texttable
......@@ -64,9 +64,8 @@ def test_tx_history_generate_table_and_pubkey_uid_display(monkeypatch):
)
for tx_list in txs_list:
assert len(tx_list) == table_columns
if tx_list != txs_list[0]:
assert "…:" in tx_list[1]
assert len(tx_list[1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
assert "…:" in tx_list[1]
assert len(tx_list[1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
# with uids
txs_list_uids = tx_history.generate_table(
......@@ -80,17 +79,16 @@ def test_tx_history_generate_table_and_pubkey_uid_display(monkeypatch):
)
for tx_list in txs_list_uids:
assert len(tx_list) == table_columns
if tx_list != txs_list[0]:
assert "…:" in tx_list[1]
assert "…:" in tx_list[1]
# check all lines
assert len(txs_list_uids[1][1]) >= min_pubkey_length_with_uid(
assert len(txs_list_uids[0][1]) >= min_pubkey_length_with_uid(
SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
)
assert len(txs_list_uids[2][1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
assert len(txs_list_uids[3][1]) >= min_pubkey_length_with_uid(
assert len(txs_list_uids[1][1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
assert len(txs_list_uids[2][1]) >= min_pubkey_length_with_uid(
SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
)
assert len(txs_list_uids[4][1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
assert len(txs_list_uids[3][1]) == SHORT_PUBKEY_LENGTH_WITH_CHECKSUM
# with full pubkeys
txs_list_full = tx_history.generate_table(
......@@ -104,14 +102,13 @@ def test_tx_history_generate_table_and_pubkey_uid_display(monkeypatch):
)
for tx_list in txs_list_full:
assert len(tx_list) == table_columns
if tx_list != txs_list_full[0]:
assert "…:" not in tx_list[1]
assert ":" in tx_list[1]
# this length is not true for multisig txs, which are very unlikely for now.
assert (
len(tx_list[1]) == MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
or len(tx_list[1]) == MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
)
assert "…:" not in tx_list[1]
assert ":" in tx_list[1]
# this length is not true for multisig txs, which are very unlikely for now.
assert (
len(tx_list[1]) == MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
or len(tx_list[1]) == MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
)
# with full pubkeys and uids
txs_list_uids_full = tx_history.generate_table(
......@@ -125,23 +122,22 @@ def test_tx_history_generate_table_and_pubkey_uid_display(monkeypatch):
)
for tx_list in txs_list_uids_full:
assert len(tx_list) == table_columns
if tx_list != txs_list_uids_full[0]:
assert "…:" not in tx_list[1]
assert ":" in tx_list[1]
assert "…:" not in tx_list[1]
assert ":" in tx_list[1]
# check all lines
assert len(txs_list_uids_full[1][1]) >= min_pubkey_length_with_uid(
assert len(txs_list_uids_full[0][1]) >= min_pubkey_length_with_uid(
MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
)
assert (
len(txs_list_uids_full[2][1]) == MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
or len(txs_list_uids_full[2][1]) == MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
len(txs_list_uids_full[1][1]) == MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
or len(txs_list_uids_full[1][1]) == MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
)
assert len(txs_list_uids_full[3][1]) >= min_pubkey_length_with_uid(
assert len(txs_list_uids_full[2][1]) >= min_pubkey_length_with_uid(
MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
)
assert (
len(txs_list_uids_full[4][1]) == MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
or len(txs_list_uids_full[4][1]) == MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
len(txs_list_uids_full[3][1]) == MIN_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
or len(txs_list_uids_full[3][1]) == MAX_FULL_PUBKEY_LENGTH_WITH_CHECKSUM
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment