feat: improved implementation and validations of configs
This commit is contained in:
@@ -72,7 +72,7 @@ class TestPlayerDTO(unittest.TestCase):
|
||||
self.assertEqual(player_dto.altsteps, 20000)
|
||||
|
||||
def test_from_dict(self):
|
||||
player_dto = PlayerConfig.from_dict(get_config_dict())
|
||||
player_dto = PlayerConfig.model_validate(get_config_dict())
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerConfig)
|
||||
self.assertIsInstance(player_dto.dice, DiceConfig)
|
||||
@@ -19,7 +19,7 @@ class TestDiceInterface(unittest.TestCase):
|
||||
logger.set_logger(stream=io.StringIO())
|
||||
|
||||
config = yaml.load(get_config_example(), Loader=yaml.Loader)
|
||||
self.config = PlayerConfig.from_dict(config["diceplayer"])
|
||||
self.config = PlayerConfig.model_validate(config["diceplayer"])
|
||||
|
||||
def test_class_instantiation(self):
|
||||
dice = DiceInterface()
|
||||
|
||||
@@ -16,7 +16,7 @@ class TestGaussianInterface(unittest.TestCase):
|
||||
logger.set_logger(stream=io.StringIO())
|
||||
|
||||
config = yaml.load(get_config_example(), Loader=yaml.Loader)
|
||||
self.config = PlayerConfig.from_dict(config["diceplayer"])
|
||||
self.config = PlayerConfig.model_validate(config["diceplayer"])
|
||||
|
||||
def test_class_instantiation(self):
|
||||
gaussian_interface = GaussianInterface()
|
||||
|
||||
Reference in New Issue
Block a user