diff --git a/tests/test_material_data_external.py b/tests/test_material_data_external.py new file mode 100644 index 0000000000..455e696a38 --- /dev/null +++ b/tests/test_material_data_external.py @@ -0,0 +1,47 @@ +#65;5403;1c"""PyNE Material expand elements test under the presence of data or no data tests""" +import os +import math +import warnings + +import nose +from nose.tools import assert_equal, assert_in, assert_true, assert_almost_equal +import numpy as np +import numpy.testing as npt + +from pyne.utils import QAWarning +from pyne.pyne_config import pyne_conf + +warnings.simplefilter("ignore", QAWarning) + +import pyne +from pyne.material import Material +from pyne import data, nucname +from pyne import utils + +from pyne.nucname import id + +if utils.use_warnings(): + utils.toggle_warnings() + +nucvec = {'H': 1.0, + 'Fe': 60.0, + 'Mn': 39.0 + } +def test_with_external_data(): + + mat = Material(nucvec,density=7.8) + mat = mat.expand_elements() + + assert_equal(id('He3') in mat.comp,False) + assert_equal(id('Co58') in mat.comp,False) + assert_equal(id('Ni58') in mat.comp,False) + + assert_equal(id('H1') in mat.comp,True) + assert_equal(id('Fe56') in mat.comp,True) + assert_equal(id('Mn55') in mat.comp,True) + + +# Run as script +# +if __name__ == "__main__": + nose.runmodule() diff --git a/tests/test_material_data_no_data.py b/tests/test_material_data_internal.py similarity index 67% rename from tests/test_material_data_no_data.py rename to tests/test_material_data_internal.py index 2285b71902..e1027ab483 100644 --- a/tests/test_material_data_no_data.py +++ b/tests/test_material_data_internal.py @@ -1,4 +1,4 @@ -"""PyNE Material expand elements test under the presence of data or no data tests""" +#65;5403;1c"""PyNE Material expand elements test under the presence of data or no data tests""" import os import math import warnings @@ -28,7 +28,7 @@ 'Mn': 39.0 } -def test_with_no_data(): +def test_with_internal_data(): orig = pyne_conf.NUC_DATA_PATH pyne_conf.NUC_DATA_PATH = b'thisisanonsensedatapath' @@ -41,20 +41,8 @@ def test_with_no_data(): assert_equal(id('H1') in mat.comp,True) assert_equal(id('Fe56') in mat.comp,True) assert_equal(id('Mn55') in mat.comp,True) - - pyne_conf.NUC_DATA_PATH = orig + -def test_with_data(): - mat = Material(nucvec,density=7.8) - mat = mat.expand_elements() - - assert_equal(id('He3') in mat.comp,False) - assert_equal(id('Co58') in mat.comp,False) - assert_equal(id('Ni58') in mat.comp,False) - - assert_equal(id('H1') in mat.comp,True) - assert_equal(id('Fe56') in mat.comp,True) - assert_equal(id('Mn55') in mat.comp,True) # Run as script #