From 2b98f7c66facfe71bf91aebc0d8cf3978e88303f Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Sun, 14 Jan 2024 14:13:59 +0200 Subject: Making it possible to flag bombs and safe areas directly. --- tests/test_board.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_board.py b/tests/test_board.py index 5fb36ad..82a2015 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -71,13 +71,17 @@ class TestBoardClass(unittest.TestCase): self.assertEqual(b.get_mask(0,0), 13) self.assertTrue(b.flag(0,0)) self.assertEqual(b.get_mask(0,0), 10) + self.assertTrue(b.flag(0,0,13)) + self.assertEqual(b.get_mask(0,0), 13) def test_flag_error_conditions(self): """ liputus ei onnistu jos avattu, alueen ulkopuolella, outo arvo """ b = Board(2) b.tiles=[[1,9],[9,9]] - b.masked[0][0]=14 + b.masked[0][0]=6 self.assertFalse(b.flag(0,0)) + b.masked[0][0]=10 + self.assertFalse(b.flag(0,0,4)) b.masked[0][0]=0 self.assertFalse(b.flag(0,0)) self.assertFalse(b.flag(2,2)) -- cgit v1.2.3