Skip to content

Commit

Permalink
Test the length of entry list
Browse files Browse the repository at this point in the history
  • Loading branch information
peikai committed Jan 28, 2023
1 parent 10bea5d commit 9907daf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pymatgen/analysis/tests/test_phase_diagram.py
Expand Up @@ -630,7 +630,12 @@ def test_el_refs(self):
# Check the keys in el_refs dict have been updated to Element object via PhaseDiagram class.
assert all(isinstance(el, Element) for el in pd.el_refs)


def test_entries_length(self):
# Assert PhaseDiagram class raises ValueError when building phase diagram with no entries
entriesList = []
with pytest.raises(ValueError, match="Unable to build phase diagram without entries."):
PhaseDiagram(entriesList)

class GrandPotentialPhaseDiagramTest(unittest.TestCase):
def setUp(self):
self.entries = EntrySet.from_csv(module_dir / "pdentries_test.csv")
Expand Down

0 comments on commit 9907daf

Please sign in to comment.