Implementa Test para Metodo make_init_file
This commit is contained in:
@@ -5,12 +5,12 @@ import unittest
|
||||
|
||||
class TestPlayerDTO(unittest.TestCase):
|
||||
def test_class_instantiation(self):
|
||||
player_dto = PlayerDTO(opt=True, maxcyc=100, nprocs=4)
|
||||
player_dto = PlayerDTO(opt=True, maxcyc=100, nprocs=4, ncores=4)
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerDTO)
|
||||
|
||||
def test_min_altsteps(self):
|
||||
player_dto = PlayerDTO(opt=True, maxcyc=100, nprocs=4, altsteps=100)
|
||||
player_dto = PlayerDTO(opt=True, maxcyc=100, nprocs=4, ncores=4, altsteps=100)
|
||||
|
||||
self.assertEqual(player_dto.altsteps, 20000)
|
||||
|
||||
@@ -18,7 +18,8 @@ class TestPlayerDTO(unittest.TestCase):
|
||||
player_dto = PlayerDTO.from_dict({
|
||||
'opt': True,
|
||||
'maxcyc': 100,
|
||||
'nprocs': 4
|
||||
'nprocs': 4,
|
||||
'ncores': 4,
|
||||
})
|
||||
|
||||
self.assertIsInstance(player_dto, PlayerDTO)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
from diceplayer.shared.interface.dice_interface import DiceInterface
|
||||
from diceplayer.shared.environment.molecule import Molecule
|
||||
from diceplayer.shared.config.step_dto import StepDTO
|
||||
|
||||
import io
|
||||
|
||||
from tests.mocks.mock_proc import MockConnection, MockProc
|
||||
|
||||
from unittest import mock
|
||||
@@ -560,6 +563,38 @@ class TestDiceInterface(unittest.TestCase):
|
||||
with self.assertRaises(FileNotFoundError):
|
||||
dice._run_dice(1, 1)
|
||||
|
||||
def test_make_init_file(self):
|
||||
dice = DiceInterface(
|
||||
{
|
||||
'ljname': 'test',
|
||||
'outname': 'test',
|
||||
'ncores': 1,
|
||||
'dens': 1.0,
|
||||
'nmol': [1],
|
||||
'nstep': [1, 1],
|
||||
}
|
||||
)
|
||||
dice.configure(
|
||||
StepDTO(
|
||||
ncores=1,
|
||||
nprocs=1,
|
||||
simulation_dir='test',
|
||||
altsteps=1,
|
||||
molecule=[
|
||||
|
||||
],
|
||||
nmol=[],
|
||||
)
|
||||
)
|
||||
|
||||
last_xyz_file = io.StringIO()
|
||||
last_xyz_file.writelines([
|
||||
'TEST',
|
||||
'TEST',
|
||||
'TEST',
|
||||
'TEST',
|
||||
])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user