def test_to_minus_y(self): result = tuple(compute_path(4, 6, 4, 2)) expected = ((4, 5), (4, 4), (4, 3), (4, 2)) self.assertEqual(expected, result)
def test_to_none(self): result = tuple(compute_path(4, 4, 4, 4)) expected = () self.assertEqual(expected, result)
def test_to_minus_x(self): result = tuple(compute_path(6, 4, 2, 4)) expected = ((5, 4), (4, 4), (3, 4), (2, 4)) self.assertEqual(expected, result)
def test_dist_x_eq_dist_y(self): result = tuple(compute_path(4, 4, 1, 1)) expected = ((3, 3), (2, 2), (1, 1)) self.assertEqual(expected, result)
def test_dist_x_gt_dist_y(self): result = tuple(compute_path(8, 2, 1, 1)) expected = ((7, 2), (6, 2), (5, 2), (4, 1), (3, 1), (2, 1), (1, 1)) self.assertEqual(expected, result)
def test_dist_x_lt_dist_y(self): result = tuple(compute_path(1, 1, 2, 4)) expected = ((1, 2), (2, 3), (2, 4)) self.assertEqual(expected, result)
def test_dist_x_gt_dist_y(self): result = tuple(compute_path(1, 2, 8, 1)) expected = ((2, 2), (3, 2), (4, 2), (5, 1), (6, 1), (7, 1), (8, 1)) self.assertEqual(expected, result)