Files
DicePlayer/tests/dice/test_dice_wrapper.py
Vitor Hideyoshi 2802f10013
Some checks failed
build and upload / test (3.10) (push) Failing after 1m45s
build and upload / pypi-upload (push) Has been skipped
refactor: restructure dice environment handling and update Python version requirement
2026-03-29 17:57:51 -03:00

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)