mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fix flake8
This commit is contained in:
parent
ae14d0e5c4
commit
2ec23be05d
@ -5,7 +5,6 @@ For more information please refer to the documentation on ReadTheDocs:
|
|||||||
http-client-server-api.html
|
http-client-server-api.html
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import re
|
|
||||||
|
|
||||||
from flask import current_app, request
|
from flask import current_app, request
|
||||||
from flask_restful import Resource, reqparse
|
from flask_restful import Resource, reqparse
|
||||||
|
@ -28,8 +28,7 @@ def txlist(b, user_pk, user2_pk, user_sk, user2_sk, genesis_block):
|
|||||||
b.write_block(block2)
|
b.write_block(block2)
|
||||||
|
|
||||||
# Create block with double spend
|
# Create block with double spend
|
||||||
tx_doublespend = Transaction.transfer(create1.to_inputs(),
|
tx_doublespend = Transaction.transfer(create1.to_inputs(), [([user_pk], 9)],
|
||||||
[([user_pk], 9)],
|
|
||||||
create1.id).sign([user2_sk])
|
create1.id).sign([user2_sk])
|
||||||
block_doublespend = b.create_block([tx_doublespend])
|
block_doublespend = b.create_block([tx_doublespend])
|
||||||
b.write_block(block_doublespend)
|
b.write_block(block_doublespend)
|
||||||
|
@ -22,8 +22,8 @@ def test_valid_txid():
|
|||||||
def test_valid_bool():
|
def test_valid_bool():
|
||||||
from bigchaindb.web.views.parameters import valid_bool
|
from bigchaindb.web.views.parameters import valid_bool
|
||||||
|
|
||||||
assert valid_bool('true') == True
|
assert valid_bool('true') is True
|
||||||
valid_bool('false') == False
|
assert valid_bool('false') is False
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
valid_bool('TRUE')
|
valid_bool('TRUE')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import builtins
|
import builtins
|
||||||
import json
|
import json
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from bigchaindb.common import crypto
|
from bigchaindb.common import crypto
|
||||||
@ -185,6 +185,7 @@ def test_post_invalid_transfer_transaction_returns_400(b, client, user_pk):
|
|||||||
|
|
||||||
def test_transactions_get_list_good(client):
|
def test_transactions_get_list_good(client):
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
def gtf(conn, **args):
|
def gtf(conn, **args):
|
||||||
return [type('', (), {'to_dict': partial(lambda a: a, arg)})
|
return [type('', (), {'to_dict': partial(lambda a: a, arg)})
|
||||||
for arg in sorted(args.items())]
|
for arg in sorted(args.items())]
|
||||||
@ -205,6 +206,8 @@ def test_transactions_get_list_good(client):
|
|||||||
|
|
||||||
|
|
||||||
def test_transactions_get_list_bad(client):
|
def test_transactions_get_list_bad(client):
|
||||||
|
def should_not_be_called():
|
||||||
|
assert False
|
||||||
with patch('bigchaindb.core.Bigchain.get_transactions_filtered',
|
with patch('bigchaindb.core.Bigchain.get_transactions_filtered',
|
||||||
lambda *_, **__: should_not_be_called()):
|
lambda *_, **__: should_not_be_called()):
|
||||||
# Test asset id validated
|
# Test asset id validated
|
||||||
|
Loading…
x
Reference in New Issue
Block a user