-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a594411
commit bc681a6
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import unittest | ||
import sys | ||
import os | ||
|
||
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
sys.path.insert(0, parent_dir) | ||
|
||
from environment.tetris import Tetris | ||
env = Tetris(10, 20) | ||
|
||
class TestNumberOfActionFunction(unittest.TestCase): | ||
def test_number_actions_with_holding_piece_t_duplicate(self): # Most unique rotations | ||
env.shape = env.SHAPES[0] | ||
env.held_shapes.append(env.SHAPES[0]) | ||
|
||
actual_actions = env.get_possible_actions() | ||
|
||
self.assertEqual(len(actual_actions), 34) | ||
|
||
def test_number_actions_with_holding_piece_s_duplicate(self): # Most unique rotations | ||
env.shape = env.SHAPES[1] | ||
env.held_shapes.append(env.SHAPES[1]) | ||
|
||
actual_actions = env.get_possible_actions() | ||
|
||
self.assertEqual(len(actual_actions), 17) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |