Skip to content

Commit e7474ba

Browse files
adamnschFlorentinD
andcommitted
Add explicit testing for NVL._serialize_entity
Co-Authored-By: Florentin Dörre <[email protected]>
1 parent 55997d3 commit e7474ba

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

python-wrapper/tests/test_render.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from selenium import webdriver
77

88
from neo4j_viz import Node, Relationship, VisualizationGraph
9+
from neo4j_viz.nvl import NVL
910
from neo4j_viz.options import Layout, Renderer
1011

1112
render_cases = {
@@ -98,15 +99,15 @@ def test_render_warnings() -> None:
9899
def test_render_non_json_serializable() -> None:
99100
import datetime
100101

101-
nodes = [
102-
Node(
103-
id=0,
104-
properties={
105-
"non-json-serializable": datetime.datetime.now(),
106-
},
107-
)
108-
]
109-
110-
VG = VisualizationGraph(nodes=nodes, relationships=[])
111-
102+
now = datetime.datetime.now()
103+
node = Node(
104+
id=0,
105+
properties={
106+
"non-json-serializable": now,
107+
},
108+
)
109+
assert str(now) in NVL._serialize_entity(node)
110+
111+
VG = VisualizationGraph(nodes=[node], relationships=[])
112+
# Should not raise an error
112113
VG.render()

0 commit comments

Comments
 (0)