Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
hive
beem
Commits
b0feb74c
Commit
b0feb74c
authored
6 years ago
by
Holger
Browse files
Options
Downloads
Patches
Plain Diff
Fix appbase detection and unit tests
parent
e0b780e2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
beemapi/rpcutils.py
+2
-3
2 additions, 3 deletions
beemapi/rpcutils.py
tests/beem/test_account.py
+1
-1
1 addition, 1 deletion
tests/beem/test_account.py
tests/beem/test_amount.py
+12
-6
12 additions, 6 deletions
tests/beem/test_amount.py
with
15 additions
and
10 deletions
beemapi/rpcutils.py
+
2
−
3
View file @
b0feb74c
...
@@ -18,10 +18,9 @@ def is_network_appbase_ready(props):
...
@@ -18,10 +18,9 @@ def is_network_appbase_ready(props):
"""
Checks if the network is appbase ready
"""
"""
Checks if the network is appbase ready
"""
network_version
=
'
0.0.0
'
network_version
=
'
0.0.0
'
if
"
STEEMIT_BLOCKCHAIN_VERSION
"
in
props
:
if
"
STEEMIT_BLOCKCHAIN_VERSION
"
in
props
:
network_version
=
props
[
'
STEEMIT_BLOCKCHAIN_VERSION
'
]
return
False
elif
"
STEEM_BLOCKCHAIN_VERSION
"
in
props
:
elif
"
STEEM_BLOCKCHAIN_VERSION
"
in
props
:
network_version
=
props
[
'
STEEM_BLOCKCHAIN_VERSION
'
]
return
True
return
network_version
==
'
0.19.10
'
def
get_query
(
appbase
,
request_id
,
api_name
,
name
,
args
):
def
get_query
(
appbase
,
request_id
,
api_name
,
name
,
args
):
...
...
This diff is collapsed.
Click to expand it.
tests/beem/test_account.py
+
1
−
1
View file @
b0feb74c
...
@@ -474,7 +474,7 @@ class Testcases(unittest.TestCase):
...
@@ -474,7 +474,7 @@ class Testcases(unittest.TestCase):
content
=
self
.
bts
.
rpc
.
get_accounts
([
account
[
"
name
"
]])[
0
]
content
=
self
.
bts
.
rpc
.
get_accounts
([
account
[
"
name
"
]])[
0
]
keys
=
list
(
content
.
keys
())
keys
=
list
(
content
.
keys
())
json_content
=
account
.
json
()
json_content
=
account
.
json
()
exclude_list
=
[]
# ['json_metadata', 'reputation', 'active_votes', 'savings_sbd_seconds']
exclude_list
=
[
'
owner_challenged
'
,
'
average_bandwidth
'
]
# ['json_metadata', 'reputation', 'active_votes', 'savings_sbd_seconds']
for
k
in
keys
:
for
k
in
keys
:
if
k
not
in
exclude_list
:
if
k
not
in
exclude_list
:
if
isinstance
(
content
[
k
],
dict
)
and
isinstance
(
json_content
[
k
],
list
):
if
isinstance
(
content
[
k
],
dict
)
and
isinstance
(
json_content
[
k
],
list
):
...
...
This diff is collapsed.
Click to expand it.
tests/beem/test_amount.py
+
12
−
6
View file @
b0feb74c
...
@@ -125,16 +125,22 @@ class Testcases(unittest.TestCase):
...
@@ -125,16 +125,22 @@ class Testcases(unittest.TestCase):
def
test_json_appbase
(
self
):
def
test_json_appbase
(
self
):
asset
=
Asset
(
"
SBD
"
,
steem_instance
=
self
.
appbase
)
asset
=
Asset
(
"
SBD
"
,
steem_instance
=
self
.
appbase
)
amount
=
Amount
(
"
1
"
,
asset
,
new_appbase_format
=
False
,
steem_instance
=
self
.
appbase
)
amount
=
Amount
(
"
1
"
,
asset
,
new_appbase_format
=
False
,
steem_instance
=
self
.
appbase
)
self
.
assertEqual
(
if
self
.
appbase
.
rpc
.
get_use_appbase
():
amount
.
json
(),
self
.
assertEqual
(
[
str
(
1
*
10
**
asset
.
precision
),
asset
.
precision
,
asset
.
asset
])
amount
.
json
(),
[
str
(
1
*
10
**
asset
.
precision
),
asset
.
precision
,
asset
.
asset
])
else
:
self
.
assertEqual
(
amount
.
json
(),
"
1.000 SBD
"
)
def
test_json_appbase2
(
self
):
def
test_json_appbase2
(
self
):
asset
=
Asset
(
"
SBD
"
,
steem_instance
=
self
.
appbase
)
asset
=
Asset
(
"
SBD
"
,
steem_instance
=
self
.
appbase
)
amount
=
Amount
(
"
1
"
,
asset
,
new_appbase_format
=
True
,
steem_instance
=
self
.
appbase
)
amount
=
Amount
(
"
1
"
,
asset
,
new_appbase_format
=
True
,
steem_instance
=
self
.
appbase
)
self
.
assertEqual
(
if
self
.
appbase
.
rpc
.
get_use_appbase
():
amount
.
json
(),
self
.
assertEqual
(
{
'
amount
'
:
str
(
1
*
10
**
asset
.
precision
),
'
nai
'
:
asset
.
asset
,
'
precision
'
:
asset
.
precision
})
amount
.
json
(),
{
'
amount
'
:
str
(
1
*
10
**
asset
.
precision
),
'
nai
'
:
asset
.
asset
,
'
precision
'
:
asset
.
precision
})
else
:
self
.
assertEqual
(
amount
.
json
(),
"
1.000 SBD
"
)
def
test_string
(
self
):
def
test_string
(
self
):
self
.
assertEqual
(
self
.
assertEqual
(
...
...
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