======================================================================================================================================== FAILURES =========================================================================================================================================
______________________________________________________________________________________________________________________ TestTransactionsEndpoint.test_transfer_assets ______________________________________________________________________________________________________________________
self = <tests.test_driver.TestTransactionsEndpoint object at 0x7fd6e0e32c50>, alice_driver = <bigchaindb_driver.driver.BigchainDB object at 0x7fd6e0e32a20>
persisted_alice_transaction = {'id': '3e724db295bc0b82362b14db0d6f6031d0cf95b7a2c91fbd58b40a034aaf826f', 'transaction': {'conditions': [{'cid': 0, '...: None, 'owners_before': ['G7J7bXF8cqSrjrxUKwcF8tCriEKC5CgyPHmtGwUi4BK3']}], 'operation': 'CREATE', ...}, 'version': 1}
bob_pubkey = '2dBVUoATxEzEqRdsi64AFsJnn2ywLCwnbNwW7K9BuVuS', bob_privkey = '4S1dzx3PSdMAfs59aBkQefPASizTs728HnhLNpYZWCad'
def test_transfer_assets(self, alice_driver, persisted_alice_transaction,
bob_pubkey, bob_privkey):
tx = alice_driver.transactions.transfer(
> persisted_alice_transaction, bob_pubkey)
tests/test_driver.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bigchaindb_driver/driver.py:212: in transfer
return self._push(signed_transfer_transaction)
bigchaindb_driver/driver.py:225: in _push
method='POST', path=self.path, json=transaction)
bigchaindb_driver/transport.py:46: in forward_request
response = connection.request(method=method, path=path, json=json)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <bigchaindb_driver.connection.Connection object at 0x7fd6e0e32160>, method = 'POST', path = '/transactions/', json = {'message': 'Invalid transaction', 'status': 400}, kwargs = {}, url = 'http://bdb-server:9984/api/v1/transactions/', response = <Response [400]>
text = '{\n "message": "Invalid transaction",\n "status": 400\n}', exc_cls = <class 'bigchaindb_driver.exceptions.TransportError'>
def request(self, method, *, path=None, json=None, **kwargs):
"""Performs an HTTP requests for the specified arguments.
Args:
method (str): HTTP method (e.g.: `'GET`'.
path (str): API endpoint path (e.g.: `'/transactions'`.
json (dict): JSON data to send along with the request.
kwargs: Optional keyword arguments.
"""
url = self.node_url + path if path else self.node_url
response = self.session.request(
method=method, url=url, json=json, **kwargs)
text = response.text
try:
json = response.json()
except ValueError:
json = None
if not (200 <= response.status_code < 300):
exc_cls = HTTP_EXCEPTIONS.get(response.status_code, TransportError)
> raise exc_cls(response.status_code, text, json)
E bigchaindb_driver.exceptions.TransportError: (400, '{\n "message": "Invalid transaction",\n "status": 400\n}', {'status': 400, 'message': 'Invalid transaction'})
bigchaindb_driver/connection.py:45: TransportError
_______________________________________________________________________________________________________________ TestTransactionsEndpoint.test_transfer_assets_with_payload ________________________________________________________________________________________________________________
self = <tests.test_driver.TestTransactionsEndpoint object at 0x7fd6e0df5908>, alice_driver = <bigchaindb_driver.driver.BigchainDB object at 0x7fd6e0df5c50>
persisted_alice_transaction = {'id': 'f1040324e5142e93542f3d66f00fd2237d3c9bd13a5d4ea1ea49044ad6f1e02b', 'transaction': {'conditions': [{'cid': 0, '...: None, 'owners_before': ['G7J7bXF8cqSrjrxUKwcF8tCriEKC5CgyPHmtGwUi4BK3']}], 'operation': 'CREATE', ...}, 'version': 1}
bob_pubkey = '2dBVUoATxEzEqRdsi64AFsJnn2ywLCwnbNwW7K9BuVuS', bob_privkey = '4S1dzx3PSdMAfs59aBkQefPASizTs728HnhLNpYZWCad'
def test_transfer_assets_with_payload(self, alice_driver,
persisted_alice_transaction,
bob_pubkey, bob_privkey):
tx = alice_driver.transactions.transfer(
> persisted_alice_transaction, bob_pubkey, payload={'a': 'b'})
tests/test_driver.py:95:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bigchaindb_driver/driver.py:212: in transfer
return self._push(signed_transfer_transaction)
bigchaindb_driver/driver.py:225: in _push
method='POST', path=self.path, json=transaction)
bigchaindb_driver/transport.py:46: in forward_request
response = connection.request(method=method, path=path, json=json)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <bigchaindb_driver.connection.Connection object at 0x7fd6e0df5d30>, method = 'POST', path = '/transactions/', json = {'message': 'Invalid transaction', 'status': 400}, kwargs = {}, url = 'http://bdb-server:9984/api/v1/transactions/', response = <Response [400]>
text = '{\n "message": "Invalid transaction",\n "status": 400\n}', exc_cls = <class 'bigchaindb_driver.exceptions.TransportError'>
def request(self, method, *, path=None, json=None, **kwargs):
"""Performs an HTTP requests for the specified arguments.
Args:
method (str): HTTP method (e.g.: `'GET`'.
path (str): API endpoint path (e.g.: `'/transactions'`.
json (dict): JSON data to send along with the request.
kwargs: Optional keyword arguments.
"""
url = self.node_url + path if path else self.node_url
response = self.session.request(
method=method, url=url, json=json, **kwargs)
text = response.text
try:
json = response.json()
except ValueError:
json = None
if not (200 <= response.status_code < 300):
exc_cls = HTTP_EXCEPTIONS.get(response.status_code, TransportError)
> raise exc_cls(response.status_code, text, json)
E bigchaindb_driver.exceptions.TransportError: (400, '{\n "message": "Invalid transaction",\n "status": 400\n}', {'status': 400, 'message': 'Invalid transaction'})
bigchaindb_driver/connection.py:45: TransportError
=========================================================================================================================== 2 failed, 19 passed in 3.62 seconds ===========================================================================================================================