mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fix some outstanding flake8 issues
This commit is contained in:
parent
631a435a63
commit
57d7a3d850
@ -4,7 +4,7 @@ import re
|
|||||||
def valid_txid(txid):
|
def valid_txid(txid):
|
||||||
if re.match('^[a-fA-F0-9]{64}$', txid):
|
if re.match('^[a-fA-F0-9]{64}$', txid):
|
||||||
return txid.lower()
|
return txid.lower()
|
||||||
raise ValueError("Invalid hash")
|
raise ValueError('Invalid hash')
|
||||||
|
|
||||||
|
|
||||||
def valid_bool(val):
|
def valid_bool(val):
|
||||||
@ -20,7 +20,7 @@ def valid_ed25519(key):
|
|||||||
if (re.match('^[1-9a-zA-Z]{43,44}$', key) and not
|
if (re.match('^[1-9a-zA-Z]{43,44}$', key) and not
|
||||||
re.match('.*[Il0O]', key)):
|
re.match('.*[Il0O]', key)):
|
||||||
return key
|
return key
|
||||||
raise ValueError("Invalid base58 ed25519 key")
|
raise ValueError('Invalid base58 ed25519 key')
|
||||||
|
|
||||||
|
|
||||||
def valid_operation(op):
|
def valid_operation(op):
|
||||||
|
@ -202,12 +202,12 @@ def test_transactions_get_list_good(client):
|
|||||||
asset_id = '1' * 64
|
asset_id = '1' * 64
|
||||||
|
|
||||||
with patch('bigchaindb.core.Bigchain.get_transactions_filtered', get_txs_patched):
|
with patch('bigchaindb.core.Bigchain.get_transactions_filtered', get_txs_patched):
|
||||||
url = TX_ENDPOINT + "?asset_id=" + asset_id
|
url = TX_ENDPOINT + '?asset_id=' + asset_id
|
||||||
assert client.get(url).json == [
|
assert client.get(url).json == [
|
||||||
['asset_id', asset_id],
|
['asset_id', asset_id],
|
||||||
['operation', None]
|
['operation', None]
|
||||||
]
|
]
|
||||||
url = TX_ENDPOINT + "?asset_id=" + asset_id + "&operation=CREATE"
|
url = TX_ENDPOINT + '?asset_id=' + asset_id + '&operation=CREATE'
|
||||||
assert client.get(url).json == [
|
assert client.get(url).json == [
|
||||||
['asset_id', asset_id],
|
['asset_id', asset_id],
|
||||||
['operation', 'CREATE']
|
['operation', 'CREATE']
|
||||||
@ -220,11 +220,11 @@ def test_transactions_get_list_bad(client):
|
|||||||
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
|
||||||
url = TX_ENDPOINT + "?asset_id=" + '1' * 63
|
url = TX_ENDPOINT + '?asset_id=' + '1' * 63
|
||||||
assert client.get(url).status_code == 400
|
assert client.get(url).status_code == 400
|
||||||
# Test operation validated
|
# Test operation validated
|
||||||
url = TX_ENDPOINT + "?asset_id=" + '1' * 64 + "&operation=CEATE"
|
url = TX_ENDPOINT + '?asset_id=' + '1' * 64 + '&operation=CEATE'
|
||||||
assert client.get(url).status_code == 400
|
assert client.get(url).status_code == 400
|
||||||
# Test asset ID required
|
# Test asset ID required
|
||||||
url = TX_ENDPOINT + "?operation=CREATE"
|
url = TX_ENDPOINT + '?operation=CREATE'
|
||||||
assert client.get(url).status_code == 400
|
assert client.get(url).status_code == 400
|
||||||
|
Loading…
x
Reference in New Issue
Block a user