File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,24 @@ def test_cycle_in_directed_graph(self):
192
192
myGraph .add_edge (3 , 3 )
193
193
194
194
self .assertTrue (myGraph .check_cycle ())
195
+
196
+ def test_add_edge_in_undirected_graph (self ):
197
+ myGraph = graph .CheckCycleUndirectedGraph ()
198
+ myGraph .add_edge (0 , 1 )
199
+ myGraph .add_edge (0 , 2 )
200
+
201
+ setFrom0 = myGraph .graph [0 ]
202
+ setFrom1 = myGraph .graph [1 ]
203
+ setFrom2 = myGraph .graph [2 ]
204
+
205
+ self .assertIsNotNone (setFrom0 )
206
+ self .assertIsNotNone (setFrom1 )
207
+ self .assertIsNotNone (setFrom2 )
208
+
209
+ self .assertIn (1 , setFrom0 )
210
+ self .assertIn (0 , setFrom1 )
211
+ self .assertIn (2 , setFrom0 )
212
+ self .assertIn (0 , setFrom2 )
195
213
196
214
def test_cycle_in_undirected_graph (self ):
197
215
myGraph = graph .CheckCycleUndirectedGraph ()
You can’t perform that action at this time.
0 commit comments