Skip to content

Commit

Permalink
chore: adjust tsts
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Oct 26, 2024
1 parent cb623a6 commit 088e17a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/py/unit/materials/test_standata_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,29 @@

def test_standata_materials_init():
"""Materials class is initialized with data based on materials_data"""
std_materials = Materials()
assert std_materials.data.standataConfig.entities is not None
assert len(std_materials.data.standataConfig.entities) >= 1
assert isinstance(std_materials.data.filesMapByName.dictionary, dict)
assert len(std_materials.data.filesMapByName.dictionary) >= 1
assert Materials.data.standataConfig.entities is not None
assert len(Materials.data.standataConfig.entities) >= 1
assert isinstance(Materials.data.filesMapByName.dictionary, dict)
assert len(Materials.data.filesMapByName.dictionary) >= 1


def test_categories_data():
"""Category map has at least one group of tags."""
std_materials = Materials()
assert std_materials.data.standataConfig.categories is not None
std_materials = Materials
assert Materials.data.standataConfig.categories is not None
assert len(std_materials.data.standataConfig.categories) >= 1


def test_get_by_name():
"""Assert correct information if found about a material."""
std_materials = Materials()
material = std_materials.get_by_name("Graphene")[0]
material = Materials.get_by_name_first_match("Graphene")
assert type(material) == dict
assert material["name"] == "C, Graphene, HEX (P6/mmm) 2D (Monolayer), 2dm-3993"
assert material["isNonPeriodic"] is False


def test_get_by_categories():
"""Assert correct information if found about a material."""
std_materials = Materials()
material = std_materials.get_by_categories("2D")
material = Materials.get_by_categories("2D")
assert isinstance(material, list)
assert material[0]["name"] == "C, Graphene, HEX (P6/mmm) 2D (Monolayer), 2dm-3993"

0 comments on commit 088e17a

Please sign in to comment.