chore: fixes tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from diceplayer.shared.config.dice_config import DiceConfig
|
||||
from diceplayer.config.dice_config import DiceConfig
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -83,7 +83,7 @@ class TestDiceDto(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_from_dict(self):
|
||||
dice_dto = DiceConfig.from_dict(
|
||||
dice_dto = DiceConfig.model_validate(
|
||||
{
|
||||
"ljname": "test",
|
||||
"outname": "test",
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
from diceplayer.shared.config.gaussian_config import GaussianDTO
|
||||
from diceplayer.config.gaussian_config import GaussianConfig
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestGaussianDTO(unittest.TestCase):
|
||||
def test_class_instantiation(self):
|
||||
gaussian_dto = GaussianDTO(
|
||||
gaussian_dto = GaussianConfig(
|
||||
level="test",
|
||||
qmprog="g16",
|
||||
keywords="test",
|
||||
)
|
||||
|
||||
self.assertIsInstance(gaussian_dto, GaussianDTO)
|
||||
self.assertIsInstance(gaussian_dto, GaussianConfig)
|
||||
|
||||
def test_is_valid_qmprog(self):
|
||||
with self.assertRaises(ValueError):
|
||||
gaussian_dto = GaussianDTO(
|
||||
gaussian_dto = GaussianConfig(
|
||||
level="test",
|
||||
qmprog="test",
|
||||
keywords="test",
|
||||
@@ -23,14 +23,14 @@ class TestGaussianDTO(unittest.TestCase):
|
||||
|
||||
def test_is_valid_level(self):
|
||||
with self.assertRaises(ValueError):
|
||||
gaussian_dto = GaussianDTO(
|
||||
gaussian_dto = GaussianConfig(
|
||||
level=None,
|
||||
qmprog="g16",
|
||||
keywords="test",
|
||||
)
|
||||
|
||||
def test_from_dict(self):
|
||||
gaussian_dto = GaussianDTO.from_dict(
|
||||
gaussian_dto = GaussianConfig.model_validate(
|
||||
{
|
||||
"level": "test",
|
||||
"qmprog": "g16",
|
||||
@@ -38,7 +38,7 @@ class TestGaussianDTO(unittest.TestCase):
|
||||
}
|
||||
)
|
||||
|
||||
self.assertIsInstance(gaussian_dto, GaussianDTO)
|
||||
self.assertIsInstance(gaussian_dto, GaussianConfig)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from diceplayer.shared.config.dice_config import DiceConfig
|
||||
from diceplayer.shared.config.gaussian_config import GaussianDTO
|
||||
from diceplayer.shared.config.player_config import PlayerConfig
|
||||
from diceplayer.config.dice_config import DiceConfig
|
||||
from diceplayer.config.gaussian_config import GaussianConfig
|
||||
from diceplayer.config.player_config import PlayerConfig
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -36,7 +36,7 @@ class TestPlayerDTO(unittest.TestCase):
|
||||
nmol=[1],
|
||||
nstep=[1, 1],
|
||||
)
|
||||
self.gaussian_dto = GaussianDTO(
|
||||
self.gaussian_dto = GaussianConfig(
|
||||
level="test",
|
||||
qmprog="g16",
|
||||
keywords="test",
|
||||
@@ -55,7 +55,7 @@ class TestPlayerDTO(unittest.TestCase):
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerConfig)
|
||||
self.assertIsInstance(player_dto.dice, DiceConfig)
|
||||
self.assertIsInstance(player_dto.gaussian, GaussianDTO)
|
||||
self.assertIsInstance(player_dto.gaussian, GaussianConfig)
|
||||
|
||||
def test_min_altsteps(self):
|
||||
player_dto = PlayerConfig(
|
||||
@@ -76,7 +76,7 @@ class TestPlayerDTO(unittest.TestCase):
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerConfig)
|
||||
self.assertIsInstance(player_dto.dice, DiceConfig)
|
||||
self.assertIsInstance(player_dto.gaussian, GaussianDTO)
|
||||
self.assertIsInstance(player_dto.gaussian, GaussianConfig)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user