Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
3b9c77c4
Commit
3b9c77c4
authored
5 years ago
by
matograine
Browse files
Options
Downloads
Patches
Plain Diff
[test]
#213
: create test for generate_unlocks
parent
7745e315
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_unit_tx.py
+33
-0
33 additions, 0 deletions
tests/test_unit_tx.py
with
33 additions
and
0 deletions
tests/test_unit_tx.py
+
33
−
0
View file @
3b9c77c4
...
@@ -15,6 +15,7 @@ from silkaj.tx import (
...
@@ -15,6 +15,7 @@ from silkaj.tx import (
generate_and_send_transaction
,
generate_and_send_transaction
,
display_sent_tx
,
display_sent_tx
,
check_transaction_values
,
check_transaction_values
,
generate_unlocks
,
)
)
from
silkaj.tui
import
display_amount
,
display_pubkey
from
silkaj.tui
import
display_amount
,
display_pubkey
from
silkaj.money
import
UDValue
from
silkaj.money
import
UDValue
...
@@ -1334,3 +1335,35 @@ def test_check_transaction_values_errors(
...
@@ -1334,3 +1335,35 @@ def test_check_transaction_values_errors(
!=
-
1
!=
-
1
)
)
assert
pytest_exit
.
type
==
SystemExit
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
==
generate_unlocks
(
listinput
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment