コード例 #1
0
ファイル: board_tests.py プロジェクト: ngoodman90/2048
 def test_move_up_when_has_merge_but_not_together_then_merged(self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 2], [0, 0, 0, 0], [0, 0, 0, 2], [0, 0, 0, 0]])
     self.assertEqual(
         [[0, 0, 0, 4], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
         g.move_up())
コード例 #2
0
ファイル: board_tests.py プロジェクト: ngoodman90/2048
 def test_move_up_when_has_one_value_and_not_possible_then_error_raised(
         self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 2], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]])
     with self.assertRaises(ValueError):
         g.move_up()