ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change
on this file since 3a473ef was
3a473ef,
checked in by Piotr Rozyczko <rozyczko@…>, 6 years ago
|
Manual update of test/ directory with changes on master - SASVIEW-996
|
-
Property mode set to
100644
|
File size:
1023 bytes
|
Line | |
---|
1 | """ |
---|
2 | Unit tests for the red2d (3-7-column) reader |
---|
3 | """ |
---|
4 | import warnings |
---|
5 | warnings.simplefilter("ignore") |
---|
6 | |
---|
7 | import unittest |
---|
8 | from sas.sascalc.dataloader.loader import Loader |
---|
9 | |
---|
10 | import os.path |
---|
11 | |
---|
12 | |
---|
13 | def find(filename): |
---|
14 | return os.path.join(os.path.dirname(__file__), filename) |
---|
15 | |
---|
16 | |
---|
17 | class abs_reader(unittest.TestCase): |
---|
18 | |
---|
19 | def setUp(self): |
---|
20 | self.loader = Loader() |
---|
21 | self.data_list = self.loader.load(find("exp18_14_igor_2dqxqy.dat")) |
---|
22 | |
---|
23 | def test_checkdata(self): |
---|
24 | """ |
---|
25 | Test .DAT file loaded as IGOR/DAT 2D Q_map |
---|
26 | """ |
---|
27 | f = self.data_list[0] |
---|
28 | # The length of the data is 10 |
---|
29 | self.assertEqual(len(self.data_list), 1) |
---|
30 | self.assertEqual(len(f.qx_data), 36864) |
---|
31 | self.assertEqual(f.qx_data[0],-0.03573497) |
---|
32 | self.assertEqual(f.qx_data[36863],0.2908819) |
---|
33 | self.assertEqual(f.Q_unit, '1/A') |
---|
34 | self.assertEqual(f.I_unit, '1/cm') |
---|
35 | |
---|
36 | self.assertEqual(f.meta_data['loader'],"IGOR/DAT 2D Q_map") |
---|
37 | |
---|
38 | |
---|
39 | if __name__ == '__main__': |
---|
40 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.