File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11import unittest
22import time
33from pydatastructs .graphs import Graph
4+ from pydatastructs .utils import AdjacencyListGraphNode , AdjacencyMatrixGraphNode
45
56class TestGraphSnapshots (unittest .TestCase ):
67 def test_snapshot_creation (self ):
78 graph = Graph (implementation = 'adjacency_list' )
8- graph .add_vertex ("A" )
9- graph .add_vertex ("B" )
9+ graph .add_vertex (AdjacencyListGraphNode ( "A" ) )
10+ graph .add_vertex (AdjacencyListGraphNode ( "B" ) )
1011 graph .add_edge ("A" , "B" , cost = 5 )
1112 graph .add_snapshot ()
1213
1314 self .assertEqual (len (graph .list_snapshots ()), 1 )
1415
1516 def test_snapshot_retrieval (self ):
1617 graph = Graph (implementation = 'adjacency_list' )
17- graph .add_vertex ("A" )
18- graph .add_vertex ("B" )
18+ graph .add_vertex (AdjacencyListGraphNode ( "A" ) )
19+ graph .add_vertex (AdjacencyListGraphNode ( "B" ) )
1920 graph .add_edge ("A" , "B" , cost = 5 )
2021 graph .add_snapshot ()
2122 snapshot_time = graph .list_snapshots ()[0 ]
You can’t perform that action at this time.
0 commit comments