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_sesans.py

    ra78a02f r3a473ef  
    33""" 
    44 
     5import os.path 
    56import unittest 
    67from sas.sascalc.dataloader.loader_exceptions import FileContentsException,\ 
     
    89from sas.sascalc.dataloader.readers.sesans_reader import Reader 
    910from sas.sascalc.dataloader.loader import  Loader 
     11 
     12 
     13def find(filename): 
     14    return os.path.join(os.path.dirname(__file__), filename) 
     15 
    1016 
    1117class sesans_reader(unittest.TestCase): 
     
    1925            Test .SES in the full loader to make sure that the file type is correctly accepted 
    2026        """ 
    21         file = Loader().load("sesans_examples/sphere2micron.ses") 
     27        file = Loader().load(find("sesans_examples/sphere2micron.ses")) 
    2228        f = file[0] 
    2329        # self.assertEqual(f, 5) 
     30        self.assertEqual(len(file), 1) 
    2431        self.assertEqual(len(f.x), 40) 
    2532        self.assertEqual(f.x[0], 391.56) 
     
    3744            Test .SES loading on a TOF dataset 
    3845        """ 
    39         file = self.loader("sesans_examples/sphere_isis.ses") 
     46        file = self.loader(find("sesans_examples/sphere_isis.ses")) 
    4047        f = file[0] 
     48        self.assertEqual(len(file), 1) 
    4149        self.assertEqual(len(f.x), 57) 
    4250        self.assertEqual(f.x[-1], 19303.4) 
     
    5462            FileContentsException, 
    5563            self.loader, 
    56             "sesans_examples/sesans_no_data.ses") 
     64            find("sesans_examples/sesans_no_data.ses")) 
    5765 
    5866    def test_sesans_no_spin_echo_unit(self): 
     
    6371            FileContentsException, 
    6472            self.loader, 
    65             "sesans_examples/no_spin_echo_unit.ses") 
     73            find("sesans_examples/no_spin_echo_unit.ses")) 
    6674 
    6775    def test_sesans_future_version(self): 
     
    7280            FileContentsException, 
    7381            self.loader, 
    74             "sesans_examples/next_gen.ses") 
     82            find("sesans_examples/next_gen.ses")) 
    7583 
    7684    def test_sesans_mandatory_headers(self): 
     
    8189            FileContentsException, 
    8290            self.loader, 
    83             "sesans_examples/no_wavelength.ses") 
     91            find("sesans_examples/no_wavelength.ses")) 
    8492 
    8593    def test_sesans_columns_match_headers(self): 
     
    9098            FileContentsException, 
    9199            self.loader, 
    92             "sesans_examples/too_many_headers.ses") 
     100            find("sesans_examples/too_many_headers.ses")) 
    93101 
    94102if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.