Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
DuniterPy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
27
Issues
27
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clients
python
DuniterPy
Commits
e4131b10
Commit
e4131b10
authored
Apr 28, 2019
by
Moul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] output conditions: add token() and compose() tests
parent
1083f3d4
Pipeline
#5334
passed with stages
in 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests/grammars/test_output.py
tests/grammars/test_output.py
+17
-0
No files found.
tests/grammars/test_output.py
View file @
e4131b10
...
...
@@ -4,6 +4,7 @@ import pypeg2
from
duniterpy.grammars.output
import
SIG
,
CLTV
,
CSV
,
XHX
,
Operator
,
Condition
pubkey
=
"DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV"
class
TestOutputgrammar
(
unittest
.
TestCase
):
def
test_sig
(
self
):
...
...
@@ -91,3 +92,19 @@ class TestOutputgrammar(unittest.TestCase):
self
.
assertEqual
(
inst
.
left
.
right
.
op
.
name
,
"&&"
)
self
.
assertEqual
(
inst
.
left
.
right
.
right
.
sha_hash
,
"309BC5E644F797F53E5A2065EAF38A173437F2E6"
)
self
.
assertEqual
(
pypeg2
.
compose
(
inst
,
Condition
),
condition
)
def
test_SIG_token_and_compose
(
self
):
self
.
assertEqual
(
SIG
.
token
(
pubkey
)
.
compose
(),
"SIG("
+
pubkey
+
")"
)
def
test_CSV_token_and_compose
(
self
):
self
.
assertEqual
(
CSV
.
token
(
pubkey
)
.
compose
(),
"CSV("
+
pubkey
+
")"
)
def
test_CLTV_token_and_compose
(
self
):
self
.
assertEqual
(
CLTV
.
token
(
pubkey
)
.
compose
(),
"CLTV("
+
pubkey
+
")"
)
def
test_HXH_token_and_compose
(
self
):
self
.
assertEqual
(
XHX
.
token
(
pubkey
)
.
compose
(),
"XHX("
+
pubkey
+
")"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment