Skip to content

Commit

Permalink
Add test for reduced formula
Browse files Browse the repository at this point in the history
  • Loading branch information
AntObi committed Nov 30, 2024
1 parent 30d7f8b commit 1805282
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions smact/tests/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ def test_as_py_struct(self):

self.assertEqual(s1_pym, py_structure)

def test_reduced_formula(self):
"""Test the reduced formula method."""
s1 = SmactStructure.from_file(os.path.join(files_dir, "CaTiO3.txt"))
s2 = SmactStructure.from_file(os.path.join(files_dir, "NaCl.txt"))

self.assertEqual(s1.reduced_formula(), "CaTiO3")
self.assertEqual(s2.reduced_formula(), "NaCl")


class StructureDBTest(unittest.TestCase):
"""Test StructureDB interface."""
Expand Down

0 comments on commit 1805282

Please sign in to comment.