33from asyncio import Lock
44from collections .abc import Hashable
55
6- from edgygraph import Graph , Node , State , Shared , START , END , Config
6+ from edgygraph import Graph , Node , State , Shared , START , END
77from edgygraph .diff import ChangeTypes , Diff , Change , ChangeConflictException
88
99
@@ -183,7 +183,7 @@ def test_chain_of_two_nodes(self):
183183 n2 = IncrementNode ()
184184 state = SimpleState (value = 0 )
185185 shared = SimpleShared ()
186- g = Graph (edges = [(START , n1 , ( n1 , n2 ), ( n2 , None ) , END )])
186+ g = Graph (edges = [(START , n1 , n2 , END )])
187187 result_state , _ = asyncio .run (g (state , shared ))
188188 assert result_state .value == 2
189189
@@ -322,7 +322,8 @@ def test_error_edge_by_exception_type(self):
322322 shared = SimpleShared ()
323323 g = Graph (edges = [(
324324 START , raiser ,
325- (ValueError , recovery ),
325+ ValueError ,
326+ recovery ,
326327 END )
327328 ])
328329 result_state , _ = asyncio .run (g (state , shared ))
@@ -336,7 +337,8 @@ def test_error_edge_by_node_and_exception_type(self):
336337 shared = SimpleShared ()
337338 g = Graph (edges = [(
338339 START , raiser ,
339- ((raiser , RuntimeError ), recovery ),
340+ (raiser , RuntimeError ),
341+ recovery ,
340342 END )
341343 ])
342344 result_state , _ = asyncio .run (g (state , shared ))
@@ -362,7 +364,8 @@ def test_wrong_exception_type_not_caught(self):
362364 shared = SimpleShared ()
363365 g = Graph (edges = [(
364366 START , raiser ,
365- (ValueError , RecoveryNode ()),
367+ ValueError ,
368+ RecoveryNode (),
366369 END )
367370 ])
368371 with pytest .raises (ExceptionGroup ):
@@ -382,8 +385,8 @@ def test_instant_node_runs_in_same_step(self):
382385 state = SimpleState (value = 0 )
383386 shared = SimpleShared ()
384387 g = Graph (edges = [(
385- START , inc ,
386- ( inc , noop , Config ( instant = True )) ,
388+ START ,
389+ [ inc , noop ] ,
387390 END )
388391 ])
389392 result_state , _ = asyncio .run (g (state , shared ))
@@ -405,9 +408,11 @@ def test_list_source_registers_for_each_node(self):
405408 shared = SimpleShared ()
406409
407410 g = Graph (edges = [(
408- START , [n1 , n3 ],
409- (n3 , n2 ),
410- ([n1 , n2 ], join ),
411+ START ,
412+ [n1 , - n3 ],
413+ n2 ,
414+ [+ n3 , + n2 ],
415+ join ,
411416 END )
412417 ])
413418 result_state , _ = asyncio .run (g (state , shared ))
0 commit comments