Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
adriente authored and ericpre committed Aug 25, 2021
1 parent c5f33cb commit 050fb44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hyperspy/tests/utils/test_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# along with HyperSpy. If not, see <http://www.gnu.org/licenses/>.

import numpy as np
import pytest

import hyperspy.api as hs
from hyperspy.misc.elements import elements_db
Expand Down Expand Up @@ -77,6 +78,12 @@ def test_density_of_mixture():
np.testing.assert_allclose(
density, hs.material.density_of_mixture(wt, elements)[0, 0])

# Testing whether the correct exception is raised upon unknown density
elements = ("Cu", "Sn", "At")
wt = (87., 12., 1.)
with pytest.raises(ValueError):
hs.material.density_of_mixture(wt,elements)


def test_mac():
np.testing.assert_allclose(
Expand Down

0 comments on commit 050fb44

Please sign in to comment.