Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
43541a5e
"lib/ui/widgets/git@git.duniter.org:zicmama/ginkgo.git" did not exist on "c9b06e0e426bd0d97b221991617cdd52a85eadc5"
Commit
43541a5e
authored
8 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Add new dividend tests
parent
16fcea5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/tests/conftest.py
+1
-1
1 addition, 1 deletion
src/sakia/tests/conftest.py
src/sakia/tests/technical/test_transactions_service.py
+18
-0
18 additions, 0 deletions
src/sakia/tests/technical/test_transactions_service.py
with
19 additions
and
1 deletion
src/sakia/tests/conftest.py
+
1
−
1
View file @
43541a5e
...
...
@@ -40,7 +40,7 @@ def meta_repo():
meta_repo
=
SakiaDatabase
(
con
,
ConnectionsRepo
(
con
),
IdentitiesRepo
(
con
),
BlockchainsRepo
(
con
),
CertificationsRepo
(
con
),
TransactionsRepo
(
con
),
NodesRepo
(
con
),
SourcesRepo
(
con
))
NodesRepo
(
con
),
SourcesRepo
(
con
)
,
DividendsRepo
(
con
)
)
meta_repo
.
prepare
()
meta_repo
.
upgrade_database
()
return
meta_repo
...
...
This diff is collapsed.
Click to expand it.
src/sakia/tests/technical/test_transactions_service.py
+
18
−
0
View file @
43541a5e
...
...
@@ -37,3 +37,21 @@ async def test_receive_tx(application_with_one_connection, fake_server, bob, ali
assert
len
(
tx_before_send
)
+
1
==
len
(
tx_after_parse
)
await
fake_server
.
close
()
@pytest.mark.asyncio
async
def
test_issue_dividend
(
application_with_one_connection
,
fake_server
,
bob
):
dividends_before_send
=
application_with_one_connection
.
transactions_services
[
fake_server
.
forge
.
currency
].
dividends
(
bob
.
key
.
pubkey
)
fake_server
.
forge
.
forge_block
()
fake_server
.
forge
.
generate_dividend
()
fake_server
.
forge
.
forge_block
()
fake_server
.
forge
.
forge_block
()
fake_server
.
forge
.
generate_dividend
()
fake_server
.
forge
.
forge_block
()
fake_server
.
forge
.
forge_block
()
new_blocks
=
fake_server
.
forge
.
blocks
[
-
5
:]
application_with_one_connection
.
transactions_services
[
fake_server
.
forge
.
currency
].
handle_new_blocks
(
new_blocks
)
dividends_after_parse
=
application_with_one_connection
.
transactions_services
[
fake_server
.
forge
.
currency
].
dividends
(
bob
.
key
.
pubkey
)
assert
len
(
dividends_before_send
)
+
2
==
len
(
dividends_after_parse
)
await
fake_server
.
close
()
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