def test_01(self): graph = MyGraph('graph_testinput1.txt') self.assertEqual(graph.get_conn_components(), [['1', '2', '3', '4', '5'], ['6', '7', '8', '9']]) self.assertTrue(graph.bicolor())
def test_02(self): graph = MyGraph('graph_testinput2.txt') self.assertEqual(graph.get_conn_components(), [['1', '2', '3'], ['4', '6', '7', '8']]) self.assertFalse(graph.bicolor())