| Conditions | 4 |
| Total Lines | 14 |
| Lines | 14 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 10 | def test_cc(self): |
||
| 11 | G = create_graph_4_connected_components() |
||
| 12 | |||
| 13 | cc = ConnectedComponents(G) |
||
| 14 | print('connected component count: ' + str(cc.count())) |
||
| 15 | |||
| 16 | self.assertEqual(3, cc.count()) |
||
| 17 | |||
| 18 | for v in range(G.vertex_count()): |
||
| 19 | print('id[' + str(v) + ']: ' + str(cc.id(v))) |
||
| 20 | for v in range(G.vertex_count()): |
||
| 21 | r = randint(0, G.vertex_count() - 1) |
||
| 22 | if cc.connected(v, r): |
||
| 23 | print(str(v) + ' is connected to ' + str(r)) |
||
| 24 | |||
| 45 |