コード例 #1
0
ファイル: document.py プロジェクト: pombredanne/python-client
def _default_link_func(document, link, **parameters):
    """
    When calling a link the default behavior is to call through
    to the HTTP transport layer.
    """
    from coreapi.transport import transition
    return transition(link.url, link.trans, parameters=parameters)
コード例 #2
0
def test_missing_hostname():
    with pytest.raises(TransportError):
        transition('http://')
コード例 #3
0
def test_unknown_scheme():
    with pytest.raises(TransportError):
        transition('ftp://example.org')
コード例 #4
0
def test_missing_scheme():
    with pytest.raises(TransportError):
        transition('example.org')
コード例 #5
0
ファイル: __init__.py プロジェクト: pombredanne/python-client
def get(url):
    return transition(url, 'follow')