39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from diceplayer.config import DiceConfig
|
|
from diceplayer.dice.dice_wrapper import DiceEnvironment, DiceWrapper
|
|
from tests._assets import ASSETS_DIR
|
|
|
|
import pytest
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
class TestDiceWrapper:
|
|
@pytest.fixture(autouse=True)
|
|
def dice_config(self) -> DiceConfig:
|
|
return DiceConfig.model_validate(
|
|
{
|
|
"nprocs": 4,
|
|
"ljname": "test",
|
|
"outname": "test",
|
|
"dens": 1.0,
|
|
"nmol": [1],
|
|
"nstep": [1, 1],
|
|
}
|
|
)
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def working_directory(self) -> Path:
|
|
return ASSETS_DIR
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def dice_wrapper(
|
|
self, dice_config: DiceConfig, working_directory: Path
|
|
) -> DiceWrapper:
|
|
return DiceWrapper(dice_config, working_directory)
|
|
|
|
def test_parse_results(self, dice_wrapper: DiceWrapper) -> None:
|
|
results = dice_wrapper.parse_results()
|
|
|
|
assert isinstance(results, list)
|
|
assert all(isinstance(env, DiceEnvironment) for env in results)
|