Finishes DiceInterface Refactoring and Continues Tests Implementation
This commit is contained in:
28
tests/shared/config/test_player_dto.py
Normal file
28
tests/shared/config/test_player_dto.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from diceplayer.shared.config.player_dto import PlayerDTO
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPlayerDTO(unittest.TestCase):
|
||||
def test_class_instantiation(self):
|
||||
player_dto = PlayerDTO(opt=True, maxcyc=100, nprocs=4)
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerDTO)
|
||||
|
||||
def test_min_altsteps(self):
|
||||
player_dto = PlayerDTO(opt=True, maxcyc=100, nprocs=4, altsteps=100)
|
||||
|
||||
self.assertEqual(player_dto.altsteps, 20000)
|
||||
|
||||
def test_from_dict(self):
|
||||
player_dto = PlayerDTO.from_dict({
|
||||
'opt': True,
|
||||
'maxcyc': 100,
|
||||
'nprocs': 4
|
||||
})
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerDTO)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user