Skip to content

Commit

Permalink
tests: add UT for run_model_devi (#1386)
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Nov 3, 2023
1 parent 75e995f commit 89b4e7f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/generator/test_make_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,37 @@ def test_make_model_devi_nopbc_nvt(self):
_check_pt(self, 0, jdata)
# shutil.rmtree('iter.000000')

def test_run_model_devi(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
with open(param_file) as fp:
jdata = json.load(fp)
_make_fake_models(0, jdata["numb_models"])
make_model_devi(0, jdata, {})
with tempfile.TemporaryDirectory() as remote_root:
run_model_devi(
0,
jdata,
{
"api_version": "1.0",
"model_devi_command": (
"test -f input.lammps"
"&& touch model_devi.out log.lammps traj/0.lammpstrj"
"&& echo lmp"
),
"model_devi_machine": {
"batch_type": "shell",
"local_root": "./",
"remote_root": remote_root,
"context_type": "local",
},
"model_devi_resources": {
"group_size": 1,
},
"model_devi_group_size": 1,
},
)

def test_run_model_devi_pimd(self):
if os.path.isdir("iter.000000"):
shutil.rmtree("iter.000000")
Expand Down

0 comments on commit 89b4e7f

Please sign in to comment.