Commit e39980cb authored by payno's avatar payno
Browse files

[core][unit test] add some assert on xas object

parent 59c92e1e
Pipeline #12919 failed with stage
in 6 minutes and 37 seconds
......@@ -95,12 +95,14 @@ class TestLarchSpectra(unittest.TestCase):
def testProcessXASObject(self):
res = larch_autobk(self.xas_object)
assert isinstance(res, XASObject)
spectrum0 = res.spectra[0]
self.assertTrue(hasattr(spectrum0, 'k'))
self.assertTrue(hasattr(spectrum0, 'chi'))
def testProcessAsDict(self):
res = larch_autobk(self.xas_object.to_dict())
assert isinstance(res, XASObject)
spectrum0 = res.spectra[0]
self.assertTrue(hasattr(spectrum0, 'k'))
self.assertTrue(hasattr(spectrum0, 'chi'))
......
......@@ -95,12 +95,14 @@ class TestLarchSpectra(unittest.TestCase):
def testProcessXASObject(self):
res = larch_mback(self.xas_object)
assert isinstance(res, XASObject)
spectrum0 = res.spectra[0]
self.assertTrue(hasattr(spectrum0, 'fpp'))
self.assertTrue(hasattr(spectrum0, 'f2'))
def testProcessAsDict(self):
res = larch_mback(self.xas_object.to_dict())
assert isinstance(res, XASObject)
spectrum0 = res.spectra[0]
self.assertTrue(hasattr(spectrum0, 'fpp'))
self.assertTrue(hasattr(spectrum0, 'f2'))
......
......@@ -95,12 +95,14 @@ class TestLarchSpectra(unittest.TestCase):
def testProcessXASObject(self):
res = larch_pre_edge(self.xas_object)
assert isinstance(res, XASObject)
spectrum0 = res.spectra[0]
self.assertTrue(hasattr(spectrum0, 'pre_edge'))
self.assertTrue(hasattr(spectrum0, 'edge'))
def testProcessAsDict(self):
res = larch_pre_edge(self.xas_object.to_dict())
assert isinstance(res, XASObject)
spectrum0 = res.spectra[0]
self.assertTrue(hasattr(spectrum0, 'pre_edge'))
self.assertTrue(hasattr(spectrum0, 'edge'))
......
......@@ -106,6 +106,7 @@ class TestLarchSpectra(unittest.TestCase):
def testProcessXASObject(self):
res = larch_xftf(self.xas_object)
assert isinstance(res, XASObject)
spectrum = res.spectra[0]
self.assertTrue(hasattr(spectrum, 'chir_re'))
self.assertTrue(hasattr(spectrum, 'chir_im'))
......@@ -114,6 +115,7 @@ class TestLarchSpectra(unittest.TestCase):
def testProcessAsDict(self):
res = larch_xftf(self.xas_object.to_dict())
assert isinstance(res, XASObject)
spectrum = res.spectra[0]
self.assertTrue(hasattr(spectrum, 'chir_re'))
self.assertTrue(hasattr(spectrum, 'chir_im'))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment