refactor: restructure dice environment handling and update Python version requirement
This commit is contained in:
38
tests/dice/test_dice_wrapper.py
Normal file
38
tests/dice/test_dice_wrapper.py
Normal file
@@ -0,0 +1,38 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user