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
0a12c68e
Commit
0a12c68e
authored
7 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
parent
4d01401d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/conftest.py
+23
-2
23 additions, 2 deletions
tests/conftest.py
with
23 additions
and
2 deletions
tests/conftest.py
+
23
−
2
View file @
0a12c68e
...
@@ -147,7 +147,7 @@ def simple_blockchain_forge(simple_forge, alice, bob):
...
@@ -147,7 +147,7 @@ def simple_blockchain_forge(simple_forge, alice, bob):
simple_forge
.
forge_block
()
simple_forge
.
forge_block
()
simple_forge
.
set_member
(
alice
.
key
.
pubkey
,
True
)
simple_forge
.
set_member
(
alice
.
key
.
pubkey
,
True
)
simple_forge
.
set_member
(
bob
.
key
.
pubkey
,
True
)
simple_forge
.
set_member
(
bob
.
key
.
pubkey
,
True
)
for
i
in
range
(
0
,
10
0
):
for
i
in
range
(
0
,
10
):
new_user
=
mirage
.
User
.
create
(
"
test_currency
"
,
"
user{0}
"
.
format
(
i
),
new_user
=
mirage
.
User
.
create
(
"
test_currency
"
,
"
user{0}
"
.
format
(
i
),
"
salt{0}
"
.
format
(
i
),
"
password{0}
"
.
format
(
i
),
"
salt{0}
"
.
format
(
i
),
"
password{0}
"
.
format
(
i
),
simple_forge
.
blocks
[
-
1
].
blockUID
)
simple_forge
.
blocks
[
-
1
].
blockUID
)
...
@@ -160,6 +160,14 @@ def simple_blockchain_forge(simple_forge, alice, bob):
...
@@ -160,6 +160,14 @@ def simple_blockchain_forge(simple_forge, alice, bob):
return
simple_forge
return
simple_forge
@pytest.fixture
def
big_blockchain_forge
(
simple_blockchain_forge
):
for
i
in
range
(
0
,
100
):
simple_blockchain_forge
.
generate_dividend
()
simple_blockchain_forge
.
forge_block
()
return
simple_blockchain_forge
@pytest.fixture
@pytest.fixture
def
fake_server_with_blockchain
(
fake_server
,
simple_blockchain_forge
):
def
fake_server_with_blockchain
(
fake_server
,
simple_blockchain_forge
):
fake_server
.
forge
=
simple_blockchain_forge
fake_server
.
forge
=
simple_blockchain_forge
...
@@ -230,7 +238,7 @@ def application_with_one_connection(application, simple_blockchain_forge, bob):
...
@@ -230,7 +238,7 @@ def application_with_one_connection(application, simple_blockchain_forge, bob):
@pytest.fixture
@pytest.fixture
def
application_with_two_connections
(
application_with_one_connection
,
simple
_blockchain_forge
,
john
):
def
application_with_two_connections
(
application_with_one_connection
,
big
_blockchain_forge
,
bob
,
john
):
connection
=
Connection
(
currency
=
"
test_currency
"
,
connection
=
Connection
(
currency
=
"
test_currency
"
,
pubkey
=
john
.
key
.
pubkey
,
uid
=
""
,
pubkey
=
john
.
key
.
pubkey
,
uid
=
""
,
scrypt_N
=
mirage
.
User
.
SCRYPT_PARAMS
.
N
,
scrypt_N
=
mirage
.
User
.
SCRYPT_PARAMS
.
N
,
...
@@ -238,6 +246,19 @@ def application_with_two_connections(application_with_one_connection, simple_blo
...
@@ -238,6 +246,19 @@ def application_with_two_connections(application_with_one_connection, simple_blo
scrypt_p
=
mirage
.
User
.
SCRYPT_PARAMS
.
p
,
scrypt_p
=
mirage
.
User
.
SCRYPT_PARAMS
.
p
,
blockstamp
=
str
(
BlockUID
.
empty
()))
blockstamp
=
str
(
BlockUID
.
empty
()))
application_with_one_connection
.
db
.
connections_repo
.
insert
(
connection
)
application_with_one_connection
.
db
.
connections_repo
.
insert
(
connection
)
for
s
in
big_blockchain_forge
.
user_identities
[
bob
.
key
.
pubkey
].
sources
:
try
:
application_with_one_connection
.
db
.
sources_repo
.
insert
(
Source
(
currency
=
big_blockchain_forge
.
currency
,
pubkey
=
bob
.
key
.
pubkey
,
identifier
=
s
.
origin_id
,
noffset
=
s
.
index
,
type
=
s
.
source
,
amount
=
s
.
amount
,
base
=
s
.
base
))
except
sqlite3
.
IntegrityError
:
pass
return
application_with_one_connection
return
application_with_one_connection
def
unitttest_exception_handler
(
exceptions
,
loop
,
context
):
def
unitttest_exception_handler
(
exceptions
,
loop
,
context
):
...
...
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