Compare commits

..

No commits in common. '95bdef0c9962ac2b7cdffc53cac1e5e181363141' and '18da1f2043b727eb0e72d05e3e33a2a06fa0056a' have entirely different histories.

@ -12,12 +12,12 @@ class Rules:
Output:
correct -> Bool: if True, the board size is correct
"""
correct = False
correct = True
try:
if self.nb_col == board.nb_col and self.nb_row == board.nb_row :
correct = True
except Exception:
print("Exception: check_board_size: col and row parameters might are compared to another type")
if not self.nb_col == board.nb_col:
correct = False
if not self.nb_row == board.nb_row:
correct = False
return correct

@ -1,25 +0,0 @@
import unittest
from parametrized import parametrized
from src.rules import Rules
class TestRules(unittest.TestCase):
@parameterized([
('Joe', 7, 6, True),
('Joe', 10, 10, False),
('Joe', '7', '6', False),
('Joe', 7, '1', False),
('Joe', '1', 6, False),
])
def test_check_board_size(self, name, col, row, no_exception=False):
Rules rules
Board board(name, col, row)
if no_exception:
try:
rules.check_board_sizes(board)
except Exception:
self.assertEqual(no_exception, False)
if __name__ == "__main__":
unittest.main()
Loading…
Cancel
Save