Skip to content

Commit

Permalink
Merge 34a8d3a into dca3806
Browse files Browse the repository at this point in the history
  • Loading branch information
imjalpreet committed Mar 7, 2015
2 parents dca3806 + 34a8d3a commit 93862b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tardis/tests/test_atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from numpy import testing
import pytest
import os
import h5py

def test_atomic_h5_readin():
data = atomic.read_basic_atom_data(atomic.default_atom_h5_path)
Expand Down Expand Up @@ -38,6 +39,23 @@ def test_atomic_symbol():
def test_atomic_symbol_reverse():
assert atomic.symbol2atomic_number['Si'] == 14

@pytest.mark.skipif(not pytest.config.getvalue("atomic-dataset"),
reason='--atomic_database was not specified')
def test_macro_atom_h5_readin():
atom_data_filename = os.path.expanduser(os.path.expandvars(
pytest.config.getvalue('atomic-dataset')))
assert os.path.exists(atom_data_filename), ("{0} atomic datafiles "
"does not seem to "
"exist".format(
atom_data_filename))
data = atomic.read_macro_atom_data(atom_data_filename)
with pytest.raises(ValueError):
raise ValueError('macro_atom_data is not in the given HDF5 file')

h5_file = h5py.File(atom_data_filename)
assert data[0] == h5_file['macro_atom_data']
assert data[1] == h5_file['macro_atom_references']

@pytest.mark.skipif(not pytest.config.getvalue("atomic-dataset"),
reason='--atomic_database was not specified')
def test_atomic_reprepare():
Expand Down

0 comments on commit 93862b5

Please sign in to comment.