Ejemplo n.º 1
0
def test_upstream_url(urn_test_request_dict):
    os.environ['JEFFERSON_ACCOUNT_TRANSFER_DPAYD_URL'] = 'account_transfer_url'
    upstreams = _Upstreams(TEST_UPSTREAM_CONFIG, validate=False)
    jsonrpc_request, urn, url, ttl, timeout = urn_test_request_dict
    test_urn = from_request(jsonrpc_request)
    upstream = Upstream.from_urn(test_urn, upstreams=upstreams)
    del os.environ['JEFFERSON_ACCOUNT_TRANSFER_DPAYD_URL']
    assert upstream.url == url
Ejemplo n.º 2
0
def test_upstream_timeout(urn_test_request_dict):
    upstreams = _Upstreams(TEST_UPSTREAM_CONFIG, validate=False)
    jsonrpc_request, urn, url, ttl, timeout = urn_test_request_dict
    test_urn = from_request(jsonrpc_request)
    upstream = Upstream.from_urn(test_urn, upstreams=upstreams)
    assert upstream.timeout == timeout
Ejemplo n.º 3
0
def test_urn_not_eq(full_urn_test_request_dict):
    jsonrpc_request, urn_parsed, urn, url, ttl, timeout = full_urn_test_request_dict
    result_urn = from_request(jsonrpc_request)
    assert result_urn != 'nope'
Ejemplo n.º 4
0
def test_urn_params_serialization(jsonrpc_request, expected):
    result_urn = from_request(jsonrpc_request)
    assert str(result_urn) == expected
Ejemplo n.º 5
0
def test_urn_hash(full_urn_test_request_dict):
    jsonrpc_request, urn_parsed, urn, url, ttl, timeout = full_urn_test_request_dict
    result_urn = from_request(jsonrpc_request)
    assert hash(result_urn) == hash(urn)