"""
Tests for ioneq class
"""
import numpy as np
import pytest
import ChiantiPy.tools.util as util
from ChiantiPy.core import ioneq
temperature = np.logspace(4,9,50)
# Element and Z should represent the same element
el = 'Fe'
z = 26
# TODO: test temperatures out of valid extrapolation range
[docs]def test_calculate_ioneq():
calc_ioneq = ioneq(el)
calc_ioneq.calculate(temperature)
assert hasattr(calc_ioneq, 'Temperature')
assert hasattr(calc_ioneq, 'Ioneq')
assert np.all(calc_ioneq.Temperature == temperature)
[docs]def test_load_ioneq():
load_ioneq = ioneq(el)
load_ioneq.load()
assert hasattr(load_ioneq, 'Temperature')
assert hasattr(load_ioneq, 'Ioneq')
[docs]def test_load_ioneq_alternate_file():
load_ioneq = ioneq(el)
load_ioneq.load(ioneqName='chianti')
assert hasattr(load_ioneq, 'Temperature')
assert hasattr(load_ioneq, 'Ioneq')