Changeset 2fd516b in sasview for DataLoader/test/testplugings.py


Ignore:
Timestamp:
Jul 9, 2008 5:05:25 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
94daf8a
Parents:
9cd84ee
Message:

change load function instead of looking in plug-in directory for readers look in readers directory. readers directory modify for test purpose

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/test/testplugings.py

    rd22da51 r2fd516b  
    1212import os  
    1313class testLoader(unittest.TestCase): 
    14     
     14    L=Loader() 
    1515    def testplugin(self): 
     16        """ test loading with readers""" 
     17         
     18        self.assertEqual(self.L.__contains__('.tiff'),True) 
     19        self.assertEqual(self.L.__contains__('.png'),True) 
     20        self.assertEqual(self.L.__contains__('.txt'),True) 
     21    def testplugin1(self): 
    1622        """ test loading with plugging""" 
    17         l=Loader() 
    18         self.assertEqual(l.__contains__('.tiff'),True) 
    19         self.assertEqual(l.__contains__('.png'),True) 
    20         self.assertEqual(l.__contains__('.txt'),True) 
    21         
     23        self.L.__setitem__(dir='plugins') 
     24        #Testing loading a txt file of 2 columns, the only reader should be read1  
     25        xload,yload,dyload=self.L.load('test_2_columns.txt')  
     26        x=[2.83954,0.204082,0.408163,0.612245,0.816327,1.02041,1.22449,1.42857,1.63265] 
     27        y=[0.6,3.44938, 5.82026,5.27591,5.2781,5.22531,7.47487,7.85852,10.2278] 
     28        dx=[] 
     29        dy=[] 
     30        self.assertEqual(len(xload),len(x)) 
     31        self.assertEqual(len(yload),len(y)) 
     32        self.assertEqual(len(dyload),0) 
     33        for i in range(len(x)): 
     34            self.assertEqual(xload[i],x[i]) 
     35            self.assertEqual(yload[i],y[i]) 
Note: See TracChangeset for help on using the changeset viewer.