diff --git a/bigchaindb/web/views/parameters.py b/bigchaindb/web/views/parameters.py index 9759563e..6eca4a97 100644 --- a/bigchaindb/web/views/parameters.py +++ b/bigchaindb/web/views/parameters.py @@ -4,7 +4,7 @@ import re def valid_txid(txid): if re.match('^[a-fA-F0-9]{64}$', txid): return txid.lower() - raise ValueError("Invalid hash") + raise ValueError('Invalid hash') def valid_bool(val): @@ -20,7 +20,7 @@ def valid_ed25519(key): if (re.match('^[1-9a-zA-Z]{43,44}$', key) and not re.match('.*[Il0O]', key)): return key - raise ValueError("Invalid base58 ed25519 key") + raise ValueError('Invalid base58 ed25519 key') def valid_operation(op): diff --git a/tests/web/test_transactions.py b/tests/web/test_transactions.py index 6970c725..71f4f0e9 100644 --- a/tests/web/test_transactions.py +++ b/tests/web/test_transactions.py @@ -202,12 +202,12 @@ def test_transactions_get_list_good(client): asset_id = '1' * 64 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 == [ ['asset_id', asset_id], ['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 == [ ['asset_id', asset_id], ['operation', 'CREATE'] @@ -220,11 +220,11 @@ def test_transactions_get_list_bad(client): with patch('bigchaindb.core.Bigchain.get_transactions_filtered', lambda *_, **__: should_not_be_called()): # 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 # 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 # Test asset ID required - url = TX_ENDPOINT + "?operation=CREATE" + url = TX_ENDPOINT + '?operation=CREATE' assert client.get(url).status_code == 400