Skip to content

Commit

Permalink
test for materials builder
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed Oct 22, 2020
1 parent 9e29c0f commit 6df440f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/emmet-builders/test_materials.py
@@ -0,0 +1,34 @@
import pytest
from maggma.stores import JSONStore, MemoryStore

from emmet.builders.vasp.task_validator import TaskValidator
from emmet.builders.vasp.materials import MaterialsBuilder


@pytest.fixture(scope="session")
def tasks_store(test_dir):
return JSONStore(test_dir / "test_si_tasks.json.gz")


@pytest.fixture(scope="session")
def validation_store(tasks_store):
validation_store = MemoryStore()
builder = TaskValidator(tasks=tasks_store, task_validation=validation_store)
builder.run()
return validation_store


@pytest.fixture
def materials_store():
return MemoryStore()


def test_materials_builder(tasks_store, validation_store, materials_store):

builder = MaterialsBuilder(
tasks=tasks_store, task_validation=validation_store, materials=materials_store
)
builder.run()
assert materials_store.count() == 1
print(materials_store.query_one())
assert materials_store.count({"deprecated": False}) == 1

0 comments on commit 6df440f

Please sign in to comment.