source: sasview/test/sasdataloader/test/utest_red2d_reader.py @ 959eb01

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 959eb01 was 959eb01, checked in by ajj, 3 years ago

normalising line endings

  • Property mode set to 100644
File size: 882 bytes
Line 
1"""
2    Unit tests for the red2d (3-7-column) reader
3"""
4import warnings
5warnings.simplefilter("ignore")
6
7import unittest
8from sas.sascalc.dataloader.loader import  Loader
9 
10import os.path
11
12class abs_reader(unittest.TestCase):
13   
14    def setUp(self):
15        self.loader = Loader()
16       
17    def test_checkdata(self):
18        """
19            Test .DAT file loaded as IGOR/DAT 2D Q_map
20        """
21        f = self.loader.load("exp18_14_igor_2dqxqy.dat")
22        # The length of the data is 10
23        self.assertEqual(len(f.qx_data),  36864)
24        self.assertEqual(f.qx_data[0],-0.03573497)
25        self.assertEqual(f.qx_data[36863],0.2908819)
26        self.assertEqual(f.Q_unit, '1/A')
27        self.assertEqual(f.I_unit, '1/cm')
28       
29        self.assertEqual(f.meta_data['loader'],"IGOR/DAT 2D Q_map")
30       
31       
32if __name__ == '__main__':
33    unittest.main()
34   
Note: See TracBrowser for help on using the repository browser.