From 822d89c50a70277186f5c845e4341236548c16b7 Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Sun, 14 Jan 2024 13:07:08 +0200 Subject: Moving game logic to game/game.py. --- tests/test_board.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/test_board.py') diff --git a/tests/test_board.py b/tests/test_board.py index 0688005..d87e825 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -70,7 +70,7 @@ class TestBoardClass(unittest.TestCase): self.assertTrue(b.flag_tile(0,0)) self.assertEqual(b.get_mask(0,0), 10) - def test_flaf_tile_error_conditions(self): + def test_flag_tile_error_conditions(self): """ liputus ei onnistu jos avattu, alueen ulkopuolella, outo arvo """ b = Board(2) b.tiles=[[1,9],[9,9]] @@ -79,4 +79,13 @@ class TestBoardClass(unittest.TestCase): b.masked[0][0]=0 self.assertFalse(b.flag_tile(0,0)) self.assertFalse(b.flag_tile(2,2)) + + def test_reveal(self): + """ paljastuksen jälkeen näkyy laatat sellaisenaan """ + b = Board(2) + b.reveal() + t = b.tiles + v = b.get_view() + for i in range(2): + self.assertEqual(v[i],t[i]) \ No newline at end of file -- cgit v1.2.3