예제 #1
0
def test_bolt_uri_only():
    data = dict(ConnectionProfile("bolt://*****:*****@host:9999',
        'user': '******',
    }
예제 #2
0
def test_explicit_auth_tuple():
    data = dict(ConnectionProfile(auth=("bob", "secret")))
    assert data == {
        'address': IPv4Address(('localhost', 7687)),
        'auth': ('bob', 'secret'),
        'host': 'localhost',
        'password': '******',
        'port': 7687,
        'port_number': 7687,
        'protocol': 'bolt',
        'scheme': 'bolt',
        'secure': False,
        'verify': True,
        'uri': 'bolt://bob@localhost:7687',
        'user': '******',
    }
예제 #3
0
def test_https_default_port():
    data = dict(ConnectionProfile("https://host"))
    assert data == {
        'address': IPv4Address(('host', 7473)),
        'auth': ('neo4j', 'password'),
        'host': 'host',
        'password': '******',
        'port': 7473,
        'port_number': 7473,
        'protocol': 'http',
        'scheme': 'https',
        'secure': True,
        'verify': True,
        'uri': 'https://neo4j@host:7473',
        'user': '******',
    }
예제 #4
0
def test_default_profile():
    data = dict(ConnectionProfile())
    assert data == {
        'address': IPv4Address(('localhost', 7687)),
        'auth': ('neo4j', 'password'),
        'host': 'localhost',
        'password': '******',
        'port': 7687,
        'port_number': 7687,
        'protocol': 'bolt',
        'scheme': 'bolt',
        'secure': False,
        'verify': True,
        'uri': 'bolt://neo4j@localhost:7687',
        'user': '******',
    }
예제 #5
0
def test_uri_and_port():
    data = dict(ConnectionProfile("bolt://*****:*****@host:8888',
        'user': '******',
    }
예제 #6
0
def test_https_uri_without_secure():
    data = dict(ConnectionProfile("https://*****:*****@host:9999',
        'user': '******',
    }
예제 #7
0
def test_profile_from_dict():
    dict1 = {
        'address': IPv4Address(('localhost', 7687)),
        'auth': ('neo4j', 'dictionary'),
        'host': 'localhost',
        'password': '******',
        'port': 7687,
        'port_number': 7687,
        'protocol': 'bolt',
        'scheme': 'bolt',
        'secure': False,
        'verify': True,
        'uri': 'bolt://neo4j@localhost:7687',
        'user': '******',
    }
    prof1 = ConnectionProfile(dict1)
    data = dict(prof1)
    assert data == dict1
예제 #8
0
def test_loading_profile_from_file():
    filename = path.join(path.dirname(__file__),
                         "..", "..", "resources", "example.ini")
    prof = ConnectionProfile.from_file(filename, "Neo4j")
    data = dict(prof)
    assert data == {
        'secure': False,
        'verify': True,
        'scheme': 'bolt',
        'user': '******',
        'password': '******',
        'address': IPv4Address(('graph.mystery.inc', 7777)),
        'auth': ('shaggy', 'velma'),
        'host': 'graph.mystery.inc',
        'port': 7777,
        'port_number': 7777,
        'protocol': 'bolt',
        'uri': 'bolt://[email protected]:7777',
    }