forked from thomas.barbier/connect4
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
579 B
25 lines
579 B
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() |