source: sasview/test/sasdataloader/test/utest_sesans.py @ bfd34a7

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since bfd34a7 was bfd34a7, checked in by Adam Washington <adam.washington@…>, 3 years ago

Test that .SES files are tagged as Sesans

  • Property mode set to 100644
File size: 941 bytes
Line 
1"""
2    Unit tests for the SESANS .ses reader
3"""
4
5import unittest
6from sas.sascalc.dataloader.loader import Loader
7
8import os.path
9
10class sesans_reader(unittest.TestCase):
11
12    def setUp(self):
13        self.loader = Loader()
14
15    def test_sesans_load(self):
16        """
17            Test .SES file loading
18        """
19        f =self.loader.load("sphere3micron.ses")
20        # self.assertEqual(f, 5)
21        self.assertEqual(len(f.x), 40)
22        self.assertEqual(f.x[0], 391.56)
23        self.assertEqual(f.x[-1], 46099)
24        self.assertEqual(f.y[-1], -0.19956)
25        self.assertEqual(f.x_unit, "A")
26        self.assertEqual(f.y_unit, "A-2 cm-1")
27        self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
28        self.assertEqual(f.sample.thickness, 0.2)
29        self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
30        self.assertEqual(f.isSesans, True)
31
32if __name__ == "__main__":
33    unittest.main()
Note: See TracBrowser for help on using the repository browser.