From cd613459ca5058c3fe008d68ffd8744a80720ba0 Mon Sep 17 00:00:00 2001
From: matograine <tom.ngr@zaclys.net>
Date: Tue, 24 Mar 2020 13:53:31 +0100
Subject: [PATCH] [test] #213: create test for generate_unlocks

---
 tests/test_unit_tx.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/test_unit_tx.py b/tests/test_unit_tx.py
index 163df17d..20b07e74 100644
--- a/tests/test_unit_tx.py
+++ b/tests/test_unit_tx.py
@@ -1406,3 +1406,35 @@ def test_check_transaction_values_errors(
             )
         assert result == ""
     assert pytest_exit.type == SystemExit
+
+
+# test generate_unlocks()
+@pytest.mark.parametrize(
+    "listinput, expected",
+    [
+        (
+            [
+                InputSource(
+                    amount=100,
+                    base=0,
+                    source="T",
+                    origin_id="1F3059ABF35D78DFB5AFFB3DEAB4F76878B04DB6A14757BBD6B600B1C19157E7",
+                    index=2,
+                ),
+                InputSource(
+                    amount=mock_ud_value,
+                    base=0,
+                    source="D",
+                    origin_id="2sq4w8yYVDWNxVWZqGWWDriFf5z7dn7iLahDCvEEotuY",
+                    index=6,
+                ),
+            ],
+            [
+                Unlock(index=0, parameters=[SIGParameter(0)]),
+                Unlock(index=1, parameters=[SIGParameter(0)]),
+            ],
+        ),
+    ],
+)
+def test_generate_unlocks(listinput, expected):
+    assert expected == tx.generate_unlocks(listinput)
-- 
GitLab