chore: fixes tests

This commit is contained in:
2026-02-26 06:23:30 -03:00
parent f56d6b6b36
commit e5c6282c86
18 changed files with 284 additions and 127 deletions

View File

@@ -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",

View File

@@ -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__":

View File

@@ -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__":

View File

@@ -1,5 +1,5 @@
from diceplayer import logger
from diceplayer.shared.config.player_config import PlayerConfig
from diceplayer.config.player_config import PlayerConfig
from diceplayer.shared.environment.atom import Atom
from diceplayer.shared.environment.molecule import Molecule
from diceplayer.shared.environment.system import System

View File

@@ -1,5 +1,5 @@
from diceplayer import logger
from diceplayer.shared.config.player_config import PlayerConfig
from diceplayer.config.player_config import PlayerConfig
from diceplayer.shared.environment.system import System
from diceplayer.shared.interface.gaussian_interface import GaussianInterface
from tests.mocks.mock_inputs import get_config_example

View File

@@ -71,6 +71,7 @@ class TestPlayer(unittest.TestCase):
"INFO:diceplayer:Environment variables:",
"INFO:diceplayer:OMP_STACKSIZE = Not set\n",
"INFO:diceplayer:------------------------------------------------------------------------------------------\n DICE variables being used in this run:\n------------------------------------------------------------------------------------------\n",
"INFO:diceplayer:combrule = *",
"INFO:diceplayer:dens = 0.75",
"INFO:diceplayer:isave = 1000",
"INFO:diceplayer:ljname = phb.ljc",
@@ -81,8 +82,10 @@ class TestPlayer(unittest.TestCase):
"INFO:diceplayer:progname = ~/.local/bin/dice",
"INFO:diceplayer:randominit = first",
"INFO:diceplayer:temp = 300.0",
"INFO:diceplayer:upbuf = 360",
"INFO:diceplayer:------------------------------------------------------------------------------------------\n GAUSSIAN variables being used in this run:\n------------------------------------------------------------------------------------------\n",
"INFO:diceplayer:chg_tol = 0.01",
"INFO:diceplayer:chgmult = [ 0 1 ]",
"INFO:diceplayer:keywords = freq",
"INFO:diceplayer:level = MP2/aug-cc-pVDZ",
"INFO:diceplayer:pop = chelpg",