def test_tall_rect(self): grid = [['a', 'b'], ['c', 'd'], ['e', 'f']] expected = "a b\nc d\ne f" self.assertEqual(expected, wg.grid_to_str(grid))
def test_wide_rect(self): grid = [['a', 'b', 'c'], ['d', 'e', 'f']] expected = "a b c\nd e f" self.assertEqual(expected, wg.grid_to_str(grid))
def test_square(self): grid = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']] expected = "a b c\nd e f\ng h i" self.assertEqual(expected, wg.grid_to_str(grid))
def test_zero_height(self): self.assertEqual("", wg.grid_to_str([]))
def test_zero_width(self): grid = [[] for _ in range(4)] self.assertEqual("", wg.grid_to_str(grid))
def test_zero_dimensions(self): self.assertEqual("", wg.grid_to_str([]))