Changeset 7a4401e in sasview for DataLoader/test/utest_ascii.py


Ignore:
Timestamp:
Apr 9, 2009 7:24:23 PM (15 years ago)
Author:
Mathieu Doucet <doucetm@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
1d64748
Parents:
7b64d95
Message:

Unit test for new ascii reader implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/test/utest_ascii.py

    r7b64d95 r7a4401e  
    1616         
    1717    def test_checkdata(self): 
    18         # Test .ABS file loaded as ascii 
     18        """ 
     19            Test .ABS file loaded as ascii 
     20        """ 
    1921        f = self.loader.load("ascii_test_1.txt") 
    2022        # The length of the data is 10 
    2123        self.assertEqual(len(f.x), 10) 
     24         
     25    def test_truncated_1(self): 
     26        """ 
     27            Test an ascii file with header and a  
     28            comment line in the middle of the data section. 
     29            The business rule says that we should stop 
     30            reading at the first comment once the data 
     31            section has started (and treat the comment 
     32            as though it were the start of a footer). 
     33        """ 
     34        # Test .ABS file loaded as ascii 
     35        f = self.loader.load("ascii_test_2.txt") 
     36        # The length of the data is 10 
     37        self.assertEqual(len(f.x), 5) 
     38         
     39    def test_truncated_2(self): 
     40        """ 
     41            Test a 6-col ascii file with header and a  
     42            line with only 2 columns in the middle of the data section. 
     43            The business rule says that we should stop 
     44            reading at the first inconsitent line. 
     45        """ 
     46        # Test .ABS file loaded as ascii 
     47        f = self.loader.load("ascii_test_3.txt") 
     48        # The length of the data is 10 
     49        self.assertEqual(len(f.x), 5) 
     50         
    2251         
    2352         
Note: See TracChangeset for help on using the changeset viewer.