示例#1
0
 def test_move_left_when_bottom_row_populated_and_merges_possible_then_error_raised(
         self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [4, 8, 4, 2]])
     with self.assertRaises(ValueError):
         g.move_left()
示例#2
0
 def test_move_left_when_has_merge_but_not_together_then_merged(self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [4, 0, 4, 0]])
     self.assertEqual(
         [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [8, 0, 0, 0]],
         g.move_left())
示例#3
0
 def test_move_left_when_has_one_value_and_not_possible_then_error_raised(
         self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [2, 0, 0, 0]])
     with self.assertRaises(ValueError):
         g.move_left()