Uploaded my most recent versions of the amazons work.
This commit is contained in:
0
amazons/test/__init__.py
Normal file
0
amazons/test/__init__.py
Normal file
BIN
amazons/test/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
amazons/test/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
amazons/test/__pycache__/test_board.cpython-310.pyc
Normal file
BIN
amazons/test/__pycache__/test_board.cpython-310.pyc
Normal file
Binary file not shown.
39
amazons/test/test_board.py
Normal file
39
amazons/test/test_board.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from unittest import TestCase
|
||||
from board import Board
|
||||
|
||||
class TestBoard(TestCase):
|
||||
def setUp(self):
|
||||
self.board = Board()
|
||||
self.tiny = Board()
|
||||
self.tiny.state = [[3,0], [0,2]]
|
||||
|
||||
def test_board_size_is_correct(self):
|
||||
self.assertEqual(len(self.board.state), 4)
|
||||
|
||||
def test_in_bounds_works(self):
|
||||
bad = [
|
||||
(-1, 1), (5, 1)
|
||||
]
|
||||
good = [
|
||||
(2, 2), (0, 0), (3, 3)
|
||||
]
|
||||
for square in bad:
|
||||
self.assertFalse(self.board.in_bounds(square))
|
||||
for square in good:
|
||||
self.assertTrue(self.board.in_bounds(square))
|
||||
|
||||
def test_get_initial_state(self):
|
||||
|
||||
def test_get_active_player_code(self):
|
||||
|
||||
def test_get_active_amazons_positions(self):
|
||||
|
||||
def test_possible_moves(self):
|
||||
|
||||
def test_get_successor_state(self, move_and_burn):
|
||||
|
||||
def test_get_possible_successor_states(self):
|
||||
|
||||
def test_is_empty(self, square):
|
||||
|
||||
def test_get_reachable_squares(self, amazon):
|
Reference in New Issue
Block a user