Changeset f344f6c in sasview


Ignore:
Timestamp:
Apr 9, 2017 5:09:13 AM (8 years ago)
Author:
Adam Washington <adam.washington@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
a81af92
Parents:
5ae40e7
Message:

Throw exception if SES file has not version data

Files:
2 edited

Legend:

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

    r5ae40e7 rf344f6c  
    6666                line = input_f.readline() 
    6767            self.params = params 
     68 
     69            if "FileFormatVersion" not in self.params: 
     70                raise RuntimeError("SES file missing FileFormatVersion") 
    6871 
    6972            if "SpinEchoLength_unit" not in self.params: 
  • test/sasdataloader/test/utest_sesans.py

    r5ae40e7 rf344f6c  
    6161            "sesans_examples/no_spin_echo_unit.ses") 
    6262 
     63    def test_sesans_no_version(self): 
     64        """ 
     65            Confirm that sesans files with no file format version raise an appropriate error 
     66        """ 
     67        self.assertRaises( 
     68            RuntimeError, 
     69            self.loader, 
     70            "sesans_examples/no_version.ses") 
     71 
    6372if __name__ == "__main__": 
    6473    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.