From 2e12cdaeea0eabdc461a2f724087ff527a5ce8e6 Mon Sep 17 00:00:00 2001
From: matograine <tom.ngr@zaclys.net>
Date: Mon, 20 Jun 2022 22:20:16 +0200
Subject: [PATCH] [enh] tx: Migrate from tabulate to texttable (#203)

---
 silkaj/tx.py          | 6 +++---
 tests/test_unit_tx.py | 4 +---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/silkaj/tx.py b/silkaj/tx.py
index c7c10ff4..b731776b 100644
--- a/silkaj/tx.py
+++ b/silkaj/tx.py
@@ -30,7 +30,6 @@ from duniterpy.documents import (
     Unlock,
 )
 from duniterpy.key import SigningKey
-from tabulate import tabulate
 
 from silkaj import auth
 from silkaj import blockchain_tools as bt
@@ -168,7 +167,8 @@ No transaction sent."
     )
 
     if not yes:
-        confirmation_table = tabulate(
+        table = tui.Table()
+        table.fill_rows(
             gen_confirmation_table(
                 issuer_pubkey,
                 pubkey_amount[0],
@@ -177,8 +177,8 @@ No transaction sent."
                 outputbackchange,
                 comment,
             ),
-            tablefmt="fancy_grid",
         )
+        confirmation_table = table.draw()
 
     if yes or click.confirm(
         f"{confirmation_table}\nDo you confirm sending this transaction?"
diff --git a/tests/test_unit_tx.py b/tests/test_unit_tx.py
index d7d5cfb1..47814aca 100644
--- a/tests/test_unit_tx.py
+++ b/tests/test_unit_tx.py
@@ -974,7 +974,7 @@ def test_send_transaction(
     """
 
     # mocking functions
-    patched_gen_confirmation_table = Mock(return_value=None)
+    patched_gen_confirmation_table = Mock(return_value=["mock list"])
     patched_handle_intermediaries_transactions = Mock(return_value=None)
 
     # patching functions
@@ -1077,8 +1077,6 @@ def construct_args(
 
 
 # generate_and_send_transaction()
-
-
 @pytest.mark.parametrize(
     "key, issuers, tx_amounts, listinput_and_amount, outputAddresses, Comment, OutputbackChange",
     [
-- 
GitLab