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.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since c4dd2fe was
46fe6a6,
checked in by Jae Cho <jhjcho@…>, 14 years ago
|
unit test for red2d_reader
|
-
Property mode set to
100644
|
File size:
902 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 DataLoader.loader import Loader |
---|
9 | |
---|
10 | import os.path |
---|
11 | |
---|
12 | class 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 | |
---|
32 | if __name__ == '__main__': |
---|
33 | unittest.main() |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.