1- import os
21import sys
2+ from typing import Any
33
44import pandas as pd
55import pytest
66from pytest_mock import MockerFixture
77
88from neo4j_viz import Node
99
10- NEO4J_URI = os .environ .get ("NEO4J_URI" , "bolt://localhost:7687" )
11-
12- NEO4J_AUTH = ("neo4j" , "password" )
13- if os .environ .get ("NEO4J_USER" ):
14- NEO4J_AUTH = (
15- os .environ .get ("NEO4J_USER" , "DUMMY" ),
16- os .environ .get ("NEO4J_PASSWORD" , "neo4j" ),
17- )
18-
1910
2011@pytest .mark .skipif (sys .version_info >= (3 , 13 ), reason = "requires python 3.12 or lower" )
2112@pytest .mark .requires_neo4j_and_gds
22- def test_from_gds_integration () -> None :
23- from graphdatascience import GraphDataScience
24-
13+ def test_from_gds_integration (gds : Any ) -> None :
2514 from neo4j_viz .gds import from_gds
2615
2716 nodes = pd .DataFrame (
2817 {
2918 "nodeId" : [0 , 1 , 2 ],
30- "labels" : ["A" , "C" , ["A" , "B" ]],
19+ "labels" : [[ "A" ], [ "C" ] , ["A" , "B" ]],
3120 "score" : [1337 , 42 , 3.14 ],
3221 "component" : [1 , 4 , 2 ],
3322 }
@@ -40,10 +29,10 @@ def test_from_gds_integration() -> None:
4029 }
4130 )
4231
43- gds = GraphDataScience (NEO4J_URI , auth = NEO4J_AUTH )
44-
4532 with gds .graph .construct ("flo" , nodes , rels ) as G :
46- VG = from_gds (gds , G , size_property = "score" , additional_node_properties = ["component" ])
33+ VG = from_gds (
34+ gds , G , size_property = "score" , additional_node_properties = ["component" ], node_radius_min_max = (3.14 , 1337 )
35+ )
4736
4837 assert len (VG .nodes ) == 3
4938 assert sorted (VG .nodes , key = lambda x : x .id ) == [
0 commit comments