Changeset 35cf5c0 in sasview


Ignore:
Timestamp:
Apr 9, 2017 5:31:32 AM (6 months ago)
Author:
Adam Washington <adam.washington@…>
Branches:
master, ESS_GUI, ESS_GUI_SasView245, costrafo411, py3, ticket-853-fit-gui-to-calc, ticket-869, ticket-887-reorg, ticket-915, ticket-947-sasmodels-docs, ticket-976, unittest-saveload
Children:
1550ee0
Parents:
e801a4e
Message:

Test that SASView complains if SES columns do not match headers

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/sesans_reader.py

    re801a4e r35cf5c0  
    9292 
    9393            data = np.loadtxt(input_f) 
     94 
     95            if data.shape[1] != len(headers): 
     96                raise RuntimeError( 
     97                    "File has {} headers, but {} columns".format( 
     98                        len(headers), 
     99                        data.shape[1])) 
     100 
    94101            if data.size < 1: 
    95102                raise RuntimeError("{} is empty".format(path)) 
  • test/sasdataloader/test/utest_sesans.py

    re801a4e r35cf5c0  
    8888            "sesans_examples/no_wavelength.ses") 
    8989 
     90    def test_sesans_columns_match_headers(self): 
     91        """ 
     92            Confirm that sesans files throw an exception if one of the mandator headers is missing. 
     93        """ 
     94        self.assertRaises( 
     95            RuntimeError, 
     96            self.loader, 
     97            "sesans_examples/too_many_headers.ses") 
     98 
    9099if __name__ == "__main__": 
    91100    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.