File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 55class TestGraphSnapshots (unittest .TestCase ):
66 def test_snapshot_creation (self ):
77 graph = Graph (implementation = 'adjacency_list' )
8- graph .add_edge ("A" , "B" , weight = 5 )
8+ graph .add_vertex ("A" )
9+ graph .add_vertex ("B" )
10+ graph .add_edge ("A" , "B" , cost = 5 )
911 graph .add_snapshot ()
1012
1113 self .assertEqual (len (graph .list_snapshots ()), 1 )
1214
1315 def test_snapshot_retrieval (self ):
1416 graph = Graph (implementation = 'adjacency_list' )
15- graph .add_edge ("A" , "B" , weight = 5 )
17+ graph .add_vertex ("A" )
18+ graph .add_vertex ("B" )
19+ graph .add_edge ("A" , "B" , cost = 5 )
1620 graph .add_snapshot ()
17-
1821 snapshot_time = graph .list_snapshots ()[0 ]
1922 retrieved_graph = graph .get_snapshot (snapshot_time )
20-
2123 self .assertEqual (retrieved_graph .is_adjacent ("A" , "B" ), True )
2224
2325 def test_invalid_snapshot (self ):
@@ -27,3 +29,4 @@ def test_invalid_snapshot(self):
2729
2830if __name__ == '__main__' :
2931 unittest .main ()
32+
You can’t perform that action at this time.
0 commit comments