Commit b18e1502 authored by payno's avatar payno
Browse files

[orangecontrib] remove some remaining unittest suite()

parent d6d5bd87
......@@ -28,15 +28,7 @@ __date__ = "06/12/2019"
import logging
import unittest
from .test_exec import suite as test_exec_suite
from .test_reprocessing import suite as test_reprocessing_suite
_logger = logging.getLogger(__name__)
def suite():
test_suite = unittest.TestSuite()
test_suite.addTest(test_exec_suite())
test_suite.addTest(test_reprocessing_suite())
return test_suite
......@@ -77,14 +77,3 @@ class TestWorkflowFromOwsFile(unittest.TestCase):
)
self.assertTrue(os.path.exists(self.output_file))
# TODO: check the values in the output file
def suite():
test_suite = unittest.TestSuite()
for ui in (TestWorkflowFromOwsFile,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -154,14 +154,3 @@ class TestReprocessingLarch(unittest.TestCase):
res_xas_obj.spectra.data.flat[0].chir_mag,
self.xas_obj_ref.spectra.data.flat[0].chir_mag,
)
def suite():
test_suite = unittest.TestSuite()
for ui in (TestReprocessingPyMca, TestReprocessingLarch):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -25,23 +25,3 @@
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "07/25/2019"
import unittest
from .test_autobk import suite as test_autobk_suite
from .test_mback import suite as test_mback_suite
from .test_mback_norm import suite as test_mback_norm_suite
from .test_pre_edge import suite as test_pre_edge_suite
from .test_workflow import suite as test_workflow_suite
from .test_xftf import suite as test_xftf_suite
def suite():
test_suite = unittest.TestSuite()
test_suite.addTest(test_autobk_suite())
test_suite.addTest(test_mback_suite())
test_suite.addTest(test_mback_norm_suite())
test_suite.addTest(test_pre_edge_suite())
test_suite.addTest(test_workflow_suite())
test_suite.addTest(test_xftf_suite())
return test_suite
......@@ -116,14 +116,3 @@ class TestLarchSpectra(unittest.TestCase):
spectrum0 = res.spectra.data.flat[0]
self.assertTrue(hasattr(spectrum0, "k"))
self.assertTrue(hasattr(spectrum0, "chi"))
def suite():
test_suite = unittest.TestSuite()
for ui in (TestLarchSpectrum, TestLarchSpectra):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -116,14 +116,3 @@ class TestLarchSpectra(unittest.TestCase):
spectrum0 = res.spectra.data.flat[0]
self.assertTrue(hasattr(spectrum0, "fpp"))
self.assertTrue(hasattr(spectrum0, "f2"))
def suite():
test_suite = unittest.TestSuite()
for ui in (TestLarchSpectrum, TestLarchSpectra):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -127,14 +127,3 @@ class TestLarchSpectra(unittest.TestCase):
spectrum0 = res.spectra.data.flat[0]
self.assertTrue(hasattr(spectrum0, "mback_mu"))
self.assertTrue(hasattr(spectrum0, "norm_mback"))
def suite():
test_suite = unittest.TestSuite()
for ui in (TestLarchSpectrum, TestLarchSpectra):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -116,14 +116,3 @@ class TestLarchSpectra(unittest.TestCase):
spectrum0 = res.spectra.data.flat[0]
self.assertTrue(hasattr(spectrum0, "pre_edge"))
self.assertTrue(hasattr(spectrum0, "edge"))
def suite():
test_suite = unittest.TestSuite()
for ui in (TestLarchSpectrum, TestLarchSpectra):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -119,14 +119,3 @@ class TestLarchWorkflows(unittest.TestCase):
)
self.assertNotEqual(spec_dk1, spec_dk2)
self.assertFalse(numpy.array_equal(spec_dk1.chir_re, spec_dk2.chir_re))
def suite():
test_suite = unittest.TestSuite()
for ui in (TestLarchWorkflows,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -137,14 +137,3 @@ class TestLarchSpectra(unittest.TestCase):
self.assertTrue(hasattr(spectrum, "chir_im"))
self.assertTrue(hasattr(spectrum, "chir"))
self.assertTrue(hasattr(spectrum, "chir_mag"))
def suite():
test_suite = unittest.TestSuite()
for ui in (TestLarchSpectrum, TestLarchSpectra):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -24,24 +24,4 @@
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "07/25/2019"
import unittest
from .test_exafs import suite as test_exafs_suite
from .test_ft import suite as test_ft_suite
from .test_io import suite as test_io_suite
from .test_k_weight import suite as test_k_weight_suite
from .test_normalization import suite as test_normalization_suite
from .test_workflow import suite as test_workflow_suite
def suite():
test_suite = unittest.TestSuite()
test_suite.addTest(test_io_suite())
test_suite.addTest(test_exafs_suite())
test_suite.addTest(test_ft_suite())
test_suite.addTest(test_k_weight_suite())
test_suite.addTest(test_normalization_suite())
test_suite.addTest(test_workflow_suite())
return test_suite
__date__ = "07/21/2021"
......@@ -88,14 +88,3 @@ class TestEXAFSSingleSpectrum(unittest.TestCase):
self.assertTrue("EXAFSKValues" in res.spectra.data.flat[0])
self.assertTrue("EXAFSSignal" in res.spectra.data.flat[0])
self.assertTrue("PostEdgeB" in res.spectra.data.flat[0])
def suite():
test_suite = unittest.TestSuite()
for ui in (TestEXAFSSingleSpectrum,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -79,14 +79,3 @@ class TestFTSingleSpectrum(unittest.TestCase):
self.assertTrue("FTRadius" in res.spectra.data.flat[0]["FT"])
self.assertTrue("FTImaginary" in res.spectra.data.flat[0]["FT"])
self.assertTrue("FTIntensity" in res.spectra.data.flat[0]["FT"])
def suite():
test_suite = unittest.TestSuite()
for ui in (TestFTSingleSpectrum,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -102,14 +102,3 @@ class TestNxWriting(unittest.TestCase):
numpy.testing.assert_allclose(
loaded_xas_obj.absorbed_beam(), self.xas_obj.absorbed_beam()
)
def suite():
test_suite = unittest.TestSuite()
for ui in (TestReadWrite, TestNxWriting):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -78,14 +78,3 @@ class TestKWeightSingleSpectrum(unittest.TestCase):
def testWithDictAsInput(self):
self.xas_obj = pymca_normalization(self.xas_obj)
pymca_k_weight(xas_obj=self.xas_obj.to_dict())
def suite():
test_suite = unittest.TestSuite()
for ui in (TestKWeightSingleSpectrum,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -121,14 +121,3 @@ class TestNormalizationMultipleSpectrum(unittest.TestCase):
def testWithDictAsInput(self):
pass
def suite():
test_suite = unittest.TestSuite()
for ui in (TestNormalizationSingleSpectrum, TestNormalizationMultipleSpectrum):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -303,14 +303,3 @@ class TestSaveFlowAuto(unittest.TestCase):
)
for key in ("KMin", "KMax"):
self.assertTrue(configuration[key] == stored_config[key])
def suite():
test_suite = unittest.TestSuite()
for ui in (TestStreamSingleSpectrum, TestWorkflowAndH5LinkedFile, TestSaveFlowAuto):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -24,20 +24,4 @@
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "07/25/2019"
import unittest
from ..pymca.test import suite as test_pymca_suite
from ..larch.test import suite as test_larch_suite
from .test_workflow import suite as test_workflow_suite
from .test_roi import suite as test_roi_suite
def suite():
test_suite = unittest.TestSuite()
test_suite.addTest(test_pymca_suite())
test_suite.addTest(test_larch_suite())
test_suite.addTest(test_roi_suite())
test_suite.addTest(test_workflow_suite())
return test_suite
__date__ = "07/21/2021"
......@@ -81,14 +81,3 @@ class TestRoi(unittest.TestCase):
def testWorkflowWithRoi(self):
""" """
pass
def suite():
test_suite = unittest.TestSuite()
for ui in (TestRoi,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
if __name__ == "__main__":
unittest.main(defaultTest="suite")
......@@ -128,10 +128,3 @@ class TestMeldWorkflow(unittest.TestCase):
writer = XASWriter()
writer.output_file = self.h5_file
writer(out)
def suite():
test_suite = unittest.TestSuite()
for ui in (TestMeldWorkflow,):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
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