From ee4d2688f9d920c3b233079dce63279da753dd41 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sun, 12 May 2019 12:38:52 +0200
Subject: [PATCH] [test] #22: add tx_history test

---
 tests/test_tx_history.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 tests/test_tx_history.py

diff --git a/tests/test_tx_history.py b/tests/test_tx_history.py
new file mode 100644
index 00000000..feae06b7
--- /dev/null
+++ b/tests/test_tx_history.py
@@ -0,0 +1,30 @@
+import pytest
+from duniterpy.api.client import Client
+from silkaj.tx_history import (
+    get_transactions_history,
+    remove_duplicate_txs,
+    generate_table,
+)
+from silkaj.constants import G1_DEFAULT_ENDPOINT
+
+
+@pytest.mark.asyncio
+async def test_tx_history_generate_table():
+    client = Client("BMAS " + " ".join(G1_DEFAULT_ENDPOINT))
+    ud_value = 10.07
+    currency = "gtest"
+    uids = False
+    table_columns = 5
+    pubkey = "78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8"
+
+    received_txs, sent_txs = list(), list()
+    await get_transactions_history(client, pubkey, received_txs, sent_txs)
+
+    remove_duplicate_txs(received_txs, sent_txs)
+    txs_list = await generate_table(
+        received_txs, sent_txs, pubkey, ud_value, currency, uids
+    )
+    await client.close()
+
+    for tx_list in txs_list:
+        assert len(tx_list) == table_columns
-- 
GitLab