Skip to content

Commit

Permalink
move vasp tasks and test for sandboxing
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed Oct 21, 2020
1 parent 2e6e7f5 commit 8702d8c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
@@ -1,4 +1,13 @@
from emmet.core.vasp.calc_types import run_type, task_type, RunType, TaskType
import json

import pytest
from maggma.stores import JSONStore, MemoryStore
from monty.io import zopen

from emmet.core import SETTINGS
from emmet.core.vasp.calc_types import RunType, TaskType, run_type, task_type
from emmet.core.vasp.task import TaskDocument
from emmet.core.vasp.validation import ValidationDoc


def test_task_tye():
Expand Down Expand Up @@ -30,3 +39,25 @@ def test_run_type():

for _type, params in params_sets:
assert run_type(params) == RunType(_type)


@pytest.fixture(scope="session")
def tasks(test_dir):
with zopen(test_dir / "test_si_tasks.json.gz") as f:
data = json.load(f)

return [TaskDocument(**d) for d in data]


def test_validator(tasks):
validation_docs = [ValidationDoc.from_task_doc(task) for task in tasks]

assert len(validation_docs) == len(tasks)
assert all(doc.valid for doc in validation_docs)


def test_sandboxing():

SETTINGS.TAGS_TO_SANDBOXES = {"test_sbx": ["test"]}
test_doc = TaskDocument(task_id="test", tags=["test"])
assert test_doc.sandboxes == ["test_sbx"]
21 changes: 0 additions & 21 deletions tests/emmet-core/vasp/test_vasp_validation.py

This file was deleted.

0 comments on commit 8702d8c

Please sign in to comment.