-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test needs to performed in stages, so as to ensure full reload of the…
… CPP data
- Loading branch information
Showing
2 changed files
with
50 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
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