Ignore:
Timestamp:
Aug 31, 2018 5:13:23 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
c1cfa80
Parents:
aa1db44
Message:

Manual update of test/ directory with changes on master - SASVIEW-996

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/sasdataloader/test/utest_averaging.py

    r2a52b0e r3a473ef  
    1313                                                  SlabY, get_q, 
    1414                                                  reader2D_converter) 
     15 
     16 
     17def find(filename): 
     18    return os.path.join(os.path.dirname(__file__), filename) 
    1519 
    1620 
     
    102106 
    103107    def setUp(self): 
    104         filepath = os.path.join(os.path.dirname( 
    105             os.path.realpath(__file__)), 'MAR07232_rest.h5') 
    106         self.data = Loader().load(filepath)[0] 
     108        filepath = find('MAR07232_rest.h5') 
     109        self.data_list = Loader().load(filepath) 
     110        self.data = self.data_list[0] 
    107111 
    108112    def test_ring(self): 
     
    117121 
    118122        o = r(self.data) 
    119         filepath = os.path.join(os.path.dirname( 
    120             os.path.realpath(__file__)), 'ring_testdata.txt') 
    121         answer = Loader().load(filepath)[0] 
    122  
     123        filepath = find('ring_testdata.txt') 
     124        answer_list = Loader().load(filepath) 
     125        answer = answer_list[0] 
     126 
     127        self.assertEqual(len(answer_list), 1) 
    123128        for i in range(r.nbins_phi - 1): 
    124129            self.assertAlmostEqual(o.x[i + 1], answer.x[i], 4) 
     
    137142        o = r(self.data) 
    138143 
    139         filepath = os.path.join(os.path.dirname( 
    140             os.path.realpath(__file__)), 'avg_testdata.txt') 
     144        filepath = find('avg_testdata.txt') 
    141145        answer = Loader().load(filepath)[0] 
    142146        for i in range(r.nbins_phi): 
     
    173177        o = r(self.data) 
    174178 
    175         filepath = os.path.join(os.path.dirname( 
    176             os.path.realpath(__file__)), 'slabx_testdata.txt') 
     179        filepath = find('slabx_testdata.txt') 
    177180        answer = Loader().load(filepath)[0] 
    178181        for i in range(len(o.x)): 
     
    192195        o = r(self.data) 
    193196 
    194         filepath = os.path.join(os.path.dirname( 
    195             os.path.realpath(__file__)), 'slaby_testdata.txt') 
     197        filepath = find('slaby_testdata.txt') 
    196198        answer = Loader().load(filepath)[0] 
    197199        for i in range(len(o.x)): 
     
    219221        o = r(self.data) 
    220222 
    221         filepath = os.path.join(os.path.dirname( 
    222             os.path.realpath(__file__)), 'ring_testdata.txt') 
     223        filepath = find('ring_testdata.txt') 
    223224        answer = Loader().load(filepath)[0] 
    224225        for i in range(len(o.x)): 
     
    237238        o = r(self.data) 
    238239 
    239         filepath = os.path.join(os.path.dirname( 
    240             os.path.realpath(__file__)), 'sectorphi_testdata.txt') 
     240        filepath = find('sectorphi_testdata.txt') 
    241241        answer = Loader().load(filepath)[0] 
    242242        for i in range(len(o.x)): 
     
    255255        o = r(self.data) 
    256256 
    257         filepath = os.path.join(os.path.dirname( 
    258             os.path.realpath(__file__)), 'sectorq_testdata.txt') 
     257        filepath = find('sectorq_testdata.txt') 
    259258        answer = Loader().load(filepath)[0] 
    260259        for i in range(len(o.x)): 
Note: See TracChangeset for help on using the changeset viewer.