Skip to content

Commit 7407c8b

Browse files
bump oxyevo tests
1 parent eba9a5a commit 7407c8b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/core/test_oxygen_evolution.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test the oxygen evolution analysis features in the client."""
22

3+
import json
34
import pytest
45
import numpy as np
56
from scipy.interpolate import splev
@@ -8,7 +9,7 @@
89
from pymatgen.core import Composition
910
from pymatgen.entries.computed_entries import ComputedEntry
1011

11-
from mp_api.client.core._oxygen_evolution import NIST_JANAF_O2_MU_T, OxygenEvolution
12+
from mp_api.client.core._oxygen_evolution import DEFAULT_CACHE_FILE, NIST_JANAF_O2_MU_T, OxygenEvolution
1213

1314

1415
def test_interp():
@@ -37,6 +38,20 @@ def test_interp():
3738
with pytest.warns(UserWarning, match="outside the fitting range"):
3839
oxyevo.mu_to_temp_spline(badval)
3940

41+
def test_get():
42+
"""Test data retrieval from NIST."""
43+
44+
data = {}
45+
data["temperature"], data["mu-mu_0K"] = OxygenEvolution().get_chempot_temp_data()
46+
assert DEFAULT_CACHE_FILE.exists()
47+
assert all(
48+
np.allclose(data[k],v) for k, v in NIST_JANAF_O2_MU_T.items()
49+
)
50+
json_data = json.loads(DEFAULT_CACHE_FILE.read_text())
51+
assert all(
52+
np.allclose(json_data[k],v) for k, v in NIST_JANAF_O2_MU_T.items()
53+
)
54+
4055

4156
def test_oxy_evo():
4257
"""Very fake Al-O chemical system for testing purposes."""

0 commit comments

Comments
 (0)