def test_init_with_headers():
    from bigchaindb_driver.transport import Transport
    from bigchaindb_driver.utils import _normalize_nodes
    headers = {'app_id': 'id'}
    nodes = _normalize_nodes('node1', 'node2', headers=headers)
    transport = Transport(*nodes)
    expected_headers = default_headers()
    expected_headers.update(headers)
    connections = transport.pool.connections
    assert connections[0]["node"].session.headers == expected_headers
    assert connections[1]["node"].session.headers == expected_headers
Beispiel #2
0
def test_iterable_of_nodes_normalization(nodes, normalized_nodes):
    from bigchaindb_driver.utils import _normalize_nodes
    assert _normalize_nodes(*nodes) == normalized_nodes
Beispiel #3
0
def test_single_node_normalization(node, normalized_node):
    from bigchaindb_driver.utils import _normalize_nodes
    assert _normalize_nodes(node) == normalized_node