-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a682aa6
commit 29f999d
Showing
6 changed files
with
6,951 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
pyEQL volume and concentration methods test suite | ||
================================================= | ||
This file contains tests for the volume and concentration-related methods | ||
used by pyEQL's Solution class | ||
""" | ||
|
||
import pytest | ||
from pyEQL import Solution | ||
|
||
|
||
@pytest.fixture() | ||
def s1(): | ||
return Solution(volume="2 L") | ||
|
||
|
||
@pytest.fixture() | ||
def s2(): | ||
return Solution([["Na+", "4 mol/L"], ["Cl-", "4 mol/L"]], volume="2 L") | ||
|
||
|
||
@pytest.fixture() | ||
def s3(): | ||
return Solution([["Na+", "4 mol/kg"], ["Cl-", "4 mol/kg"]], volume="2 L") | ||
|
||
|
||
@pytest.fixture() | ||
def s4(): | ||
return Solution([["Na+", "8 mol"], ["Cl-", "8 mol"]], volume="2 L") | ||
|
||
|
||
def test_db_connect(): | ||
Solution(database=None) | ||
|
||
|
||
def test_serialization(s1, s2, s3): | ||
assert isinstance(s1.as_dict(), dict) | ||
s1_new = Solution.from_dict(s1.as_dict()) | ||
assert s1_new.volume.magnitude == 2 |