Changeset 1fc50fb2 in sasview for test/sasdataloader


Ignore:
Timestamp:
Apr 17, 2017 12:21:58 PM (8 years ago)
Author:
krzywon
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:
7b15990
Parents:
717e456
git-author:
Jeff Krzywon <krzywon@…> (04/17/17 12:21:58)
git-committer:
krzywon <krzywon@…> (04/17/17 12:21:58)
Message:

Unit test to be sure written file exists before trying to open it.

File:
1 edited

Legend:

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

    r17c9436 r1fc50fb2  
    111111        xmlreader.set_processing_instructions() 
    112112        self.assertTrue(valid) 
    113         fo = open(self.isis_1_1) 
    114         fo.read() 
    115         fo.close() 
    116113        reader_generic = Loader() 
    117114        dataloader = reader_generic.load(self.isis_1_1) 
     
    124121            self._check_data_1_1(cansasreader[i]) 
    125122            reader_generic.save(self.write_1_1_filename, dataloader[i], None) 
    126             fo = open(self.write_1_1_filename) 
    127             fo.read() 
    128             fo.close() 
    129123            reader2 = Loader() 
     124            self.assertTrue(os.path.isfile(self.write_1_1_filename)) 
    130125            return_data = reader2.load(self.write_1_1_filename) 
    131126            written_data = return_data[0] 
     
    202197            reader_generic.save(self.write_1_0_filename, dataloader[i], None) 
    203198            reader2 = Reader() 
     199            self.assertTrue(os.path.isfile(self.write_1_0_filename)) 
    204200            return_data = reader2.read(self.write_1_0_filename) 
    205201            written_data = return_data[0] 
Note: See TracChangeset for help on using the changeset viewer.