from numpy.testing import assert_equal
from falass import dataformat
import unittest
[docs]class TestQData(unittest.TestCase):
[docs] def test_qdata(self):
a = dataformat.QData(1., 2., 3., 4.)
assert_equal(a.q, 1.)
assert_equal(a.i, 2.)
assert_equal(a.di, 3.)
assert_equal(a.dq, 4.)
[docs]class TestScatLens(unittest.TestCase):
[docs] def test_scatlens(self):
a = dataformat.ScatLens('C1', 1., 0.)
assert_equal(a.atom, 'C1')
assert_equal(a.real, 1.0e-5)
assert_equal(a.imag, 0.0)
[docs]class TestAtomPositions(unittest.TestCase):
[docs] def test_atompositions(self):
a = dataformat.AtomPositions('C1', 1.000)
assert_equal(a.atom, 'C1')
assert_equal(a.zpos, 1.000)
[docs]class TestSLDPro(unittest.TestCase):
[docs] def test_sldpro(self):
a = dataformat.SLDPro(1., 2., 3.)
assert_equal(a.thick, 1.)
assert_equal(a.real, 2.)
assert_equal(a.imag, 3.)
[docs]class TestAtom3Position(unittest.TestCase):
[docs] def test_atom3positions(self):
a = dataformat.Atom3Positions('C1', 2., 3., 4.)
assert_equal(a.atom, 'C1')
assert_equal(a.x, 2.)
assert_equal(a.y, 3.)
assert_equal(a.z, 4.)