Skip to content

Commit 2207194

Browse files
Modify test_graph_snapshots.py
1 parent b8330b2 commit 2207194

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_graph_snapshots.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
class 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

2830
if __name__ == '__main__':
2931
unittest.main()
32+

0 commit comments

Comments
 (0)