Changeset 3ee0451 in sasview


Ignore:
Timestamp:
Feb 14, 2018 11:41:43 AM (7 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
425feff
Parents:
c36c09f
Message:

Unit test for error message handling with 'deprecated' data sets.

Location:
test/sasdataloader/test
Files:
1 added
1 edited

Legend:

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

    rf53d684 r3ee0451  
    99 
    1010from sas.sascalc.dataloader.data_info import DataInfo, plottable_1D 
     11from sas.sascalc.dataloader.loader import Loader 
    1112from sas.sascalc.dataloader.file_reader_base_class import FileReader 
    1213 
     
    2425        self.bad_file = find("ACB123.txt") 
    2526        self.good_file = find("123ABC.txt") 
     27        self.generic_reader = Loader() 
     28        self.deprecated_file_type = find("FEB18012.ASC") 
    2629 
    2730    def test_bad_file_path(self): 
     
    3639        self.assertEqual(len(output), 1) 
    3740        self.assertEqual(output[0].meta_data["blah"], '123ABC exists!') 
     41 
     42    def test_old_file_types(self): 
     43        f = self.generic_reader.load(self.deprecated_file_type) 
     44        last_f = f[0] 
     45        if hasattr(last_f, "errors"): 
     46            self.assertEquals(len(last_f.errors), 1) 
     47        else: 
     48            self.fail("Errors did not propogate to the file properly.") 
    3849 
    3950    def tearDown(self): 
Note: See TracChangeset for help on using the changeset viewer.