Changeset 3617aa2 in sasview for DataLoader/test


Ignore:
Timestamp:
Apr 10, 2009 6:46:45 PM (16 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:
c9795f6
Parents:
8adea21
Message:

DataLoader?: Added a new unit test

Location:
DataLoader/test
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/test/utest_ascii.py

    r8adea21 r3617aa2  
    4646        # Test .ABS file loaded as ascii 
    4747        f = self.loader.load("ascii_test_3.txt") 
    48         # The length of the data is 10 
     48        # The length of the data is 5 
    4949        self.assertEqual(len(f.x), 5) 
    5050         
     
    5858        # Test .ABS file loaded as ascii 
    5959        f = self.loader.load("ascii_test_4.abs") 
    60         # The length of the data is 10 
     60        # The length of the data is 5 
    6161        self.assertEqual(len(f.x), 5) 
     62         
     63    def test_truncated_4(self): 
     64        """ 
     65            Test mix of 6-col and 2-col. 
     66            Only the last 5 2-col lines should be read. 
     67        """ 
     68        # Test .ABS file loaded as ascii 
     69        f = self.loader.load("ascii_test_5.txt") 
     70        # The length of the data is 5 
     71        self.assertEqual(len(f.x), 5) 
     72        self.assertEqual(f.x[0],0.02879) 
     73        self.assertEqual(f.x[4],0.0497) 
    6274         
    6375         
Note: See TracChangeset for help on using the changeset viewer.