Changeset fe15198 in sasview for test/sasdataloader
- Timestamp:
- Oct 25, 2017 7:11:21 AM (7 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 3648cbf
- Parents:
- 61f329f0
- Location:
- test/sasdataloader/test
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_abs_reader.py
r574adc7 rfe15198 20 20 def setUp(self): 21 21 reader = AbsReader() 22 data= reader.read("jan08002.ABS")23 self.data = data[0]22 self.data_list = reader.read("jan08002.ABS") 23 self.data = self.data_list[0] 24 24 25 25 def test_abs_checkdata(self): … … 76 76 def setUp(self): 77 77 reader = DANSEReader() 78 data= reader.read("MP_New.sans")79 self.data = data[0]78 self.data_list = reader.read("MP_New.sans") 79 self.data = self.data_list[0] 80 80 81 81 def test_checkdata(self): … … 87 87 tests won't pass 88 88 """ 89 self.assertEqual(len(self.data_list), 1) 89 90 self.assertEqual(self.data.filename, "MP_New.sans") 90 91 self.assertEqual(self.data.meta_data['loader'], "DANSE") … … 114 115 # the generic loader should work as well 115 116 data = Loader().load("MP_New.sans") 117 self.assertEqual(len(data), 1) 116 118 self.assertEqual(data[0].meta_data['loader'], "DANSE") 117 119 … … 121 123 def setUp(self): 122 124 reader = CANSASReader() 123 data= reader.read("cansas1d.xml")124 self.data = data[0]125 self.data_list = reader.read("cansas1d.xml") 126 self.data = self.data_list[0] 125 127 126 128 def test_generic_loader(self): 127 129 # the generic loader should work as well 128 130 data = Loader().load("cansas1d.xml") 131 self.assertEqual(len(data), 1) 129 132 self.assertEqual(data[0].meta_data['loader'], "CanSAS XML 1D") 130 133 … … 141 144 tests won't pass 142 145 """ 146 self.assertEqual(len(self.data_list), 1) 143 147 self.assertEqual(self.data.run[0], "1234") 144 148 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") … … 281 285 data = Loader().load(filename) 282 286 self.data = data[0] 287 self.assertEqual(len(data), 1) 283 288 self.assertEqual(self.data.filename, filename) 284 289 self._checkdata() … … 294 299 data = CANSASReader().read(filename) 295 300 self.data = data[0] 301 self.assertEqual(len(data), 1) 296 302 self.assertEqual(self.data.filename, filename) 297 303 self._checkdata() … … 305 311 data = CANSASReader().read(filename) 306 312 self.data = data[0] 313 self.assertEqual(len(data), 1) 307 314 self.assertEqual(self.data.filename, filename) 308 315 # The followed should not have been loaded … … 321 328 data = CANSASReader().read(filename) 322 329 self.data = data[0] 330 self.assertEqual(len(data), 1) 331 self.assertEqual(len(self.data_list), 1) 323 332 self.assertEqual(self.data.filename, filename) 324 333 self.assertEqual(self.data.run[0], "1234") -
test/sasdataloader/test/utest_ascii.py
ra78a02f rfe15198 29 29 """ 30 30 # The length of the data is 10 31 self.assertEqual(len(self.f1_list), 1) 32 self.assertEqual(len(self.f2_list), 1) 33 self.assertEqual(len(self.f3_list), 1) 34 self.assertEqual(len(self.f4_list), 1) 35 self.assertEqual(len(self.f5_list), 1) 31 36 self.assertEqual(len(self.f1.x), 10) 32 37 self.assertEqual(self.f1.x[0],0.002618) -
test/sasdataloader/test/utest_averaging.py
r2a52b0e rfe15198 104 104 filepath = os.path.join(os.path.dirname( 105 105 os.path.realpath(__file__)), 'MAR07232_rest.h5') 106 self.data = Loader().load(filepath)[0] 106 self.data_list = Loader().load(filepath) 107 self.data = self.data_list[0] 107 108 108 109 def test_ring(self): … … 119 120 filepath = os.path.join(os.path.dirname( 120 121 os.path.realpath(__file__)), 'ring_testdata.txt') 121 answer = Loader().load(filepath)[0] 122 122 answer_list = Loader().load(filepath) 123 answer = answer_list[0] 124 125 self.assertEqual(len(answer_list), 1) 123 126 for i in range(r.nbins_phi - 1): 124 127 self.assertAlmostEqual(o.x[i + 1], answer.x[i], 4) -
test/sasdataloader/test/utest_red2d_reader.py
r248ff73 rfe15198 14 14 def setUp(self): 15 15 self.loader = Loader() 16 self.data_list = self.loader.load("exp18_14_igor_2dqxqy.dat") 16 17 17 18 def test_checkdata(self): … … 19 20 Test .DAT file loaded as IGOR/DAT 2D Q_map 20 21 """ 21 f = self. loader.load("exp18_14_igor_2dqxqy.dat")[0]22 f = self.data_list[0] 22 23 # The length of the data is 10 24 self.assertEqual(len(self.data_list), 1) 23 25 self.assertEqual(len(f.qx_data), 36864) 24 26 self.assertEqual(f.qx_data[0],-0.03573497) -
test/sasdataloader/test/utest_sesans.py
ra78a02f rfe15198 22 22 f = file[0] 23 23 # self.assertEqual(f, 5) 24 self.assertEqual(len(file), 1) 24 25 self.assertEqual(len(f.x), 40) 25 26 self.assertEqual(f.x[0], 391.56) … … 39 40 file = self.loader("sesans_examples/sphere_isis.ses") 40 41 f = file[0] 42 self.assertEqual(len(file), 1) 41 43 self.assertEqual(len(f.x), 57) 42 44 self.assertEqual(f.x[-1], 19303.4)
Note: See TracChangeset
for help on using the changeset viewer.