Skip to content

Commit aaa4d7c

Browse files
Add adapter test for gibbs
1 parent ad9c096 commit aaa4d7c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

backend/tests/models/test_gibbs_adapter.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,28 @@ def test_no_overlapping_substances():
8686
assert len(intersection) == 0, (
8787
f"The lists in gibbs adapter should have no overlap, found {intersection} in both lists"
8888
)
89+
90+
91+
async def test_simple_run():
92+
concentrations = {
93+
"H2O": 30,
94+
"H2S": 10,
95+
"SO2": 10,
96+
"NO2": 1.5,
97+
"O2": 10,
98+
}
99+
parameters = {
100+
"temperature": 273,
101+
"pressure": 100,
102+
"equation_of_state": _EquationOfState.SRK,
103+
}
104+
105+
# Act
106+
adapter = GibbsMinimizationModelAdapter(
107+
concentrations=concentrations, parameters=parameters, jwt_token=None
108+
)
109+
110+
concs = await adapter.run()
111+
112+
pytest.approx(concs["NH4HSO4"], 1.5, abs=0.01)
113+
pytest.approx(concs["S8"], 0.4, abs=0.01)

0 commit comments

Comments
 (0)