コード例 #1
0
ファイル: neo4j_test.py プロジェクト: EricEllett/py2neo
def test_authentication_adds_the_correct_header():
    from py2neo.core import _headers
    _headers.clear()
    _headers.update({None: [("X-Stream", "true")]})
    authenticate("localhost:7474", "arthur", "excalibur")
    headers = _get_headers("localhost:7474")
    assert headers['Authorization'] == 'Basic YXJ0aHVyOmV4Y2FsaWJ1cg=='
コード例 #2
0
def test_authentication_adds_the_correct_header():
    from py2neo.core import _headers
    _headers.clear()
    _headers.update({None: [("X-Stream", "true")]})
    authenticate("localhost:7474", "arthur", "excalibur")
    headers = _get_headers("localhost:7474")
    assert headers['Authorization'] == 'Basic YXJ0aHVyOmV4Y2FsaWJ1cg=='
コード例 #3
0
ファイル: neo4j_test.py プロジェクト: EricEllett/py2neo
def test_implicit_authentication_through_resource_constructor():
    from py2neo.core import _headers, Resource
    _headers.clear()
    _headers.update({None: [("X-Stream", "true")]})
    resource = Resource("http://*****:*****@localhost:7474/")
    headers = _get_headers("localhost:7474")
    assert headers['Authorization'] == 'Basic YXJ0aHVyOmV4Y2FsaWJ1cg=='
    assert resource.headers['Authorization'] == 'Basic YXJ0aHVyOmV4Y2FsaWJ1cg=='
コード例 #4
0
def test_implicit_authentication_through_resource_constructor():
    from py2neo.core import _headers, Resource
    _headers.clear()
    _headers.update({None: [("X-Stream", "true")]})
    resource = Resource("http://*****:*****@localhost:7474/")
    headers = _get_headers("localhost:7474")
    assert headers['Authorization'] == 'Basic YXJ0aHVyOmV4Y2FsaWJ1cg=='
    assert resource.headers['Authorization'] == 'Basic YXJ0aHVyOmV4Y2FsaWJ1cg=='