Changeset f53d684 in sasview for test/sasinvariant


Ignore:
Timestamp:
Dec 5, 2017 10:31:07 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
5bb05a4
Parents:
3053a4a
git-author:
Stuart Prescott <llimeht@…> (12/05/17 10:31:07)
git-committer:
Paul Kienzle <pkienzle@…> (12/05/17 10:31:07)
Message:

Make tests work from any directory and functional without special runner script (#124)

Location:
test/sasinvariant/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/sasinvariant/test/utest_data_handling.py

    r9a5097c rf53d684  
    88copyright 2010, University of Tennessee 
    99""" 
     10 
     11import os.path 
    1012import unittest 
    1113import math 
     
    1517 
    1618from sas.sascalc.invariant import invariant 
    17      
     19 
     20 
     21def find(filename): 
     22    return os.path.join(os.path.dirname(__file__), filename) 
     23 
     24 
    1825class TestLinearFit(unittest.TestCase): 
    1926    """ 
     
    94101    """ 
    95102    def setUp(self): 
    96         data = Loader().load("latex_smeared_slit.xml") 
     103        data = Loader().load(find("latex_smeared_slit.xml")) 
    97104        self.data = data[0] 
    98105        self.data.dxl = None 
     
    676683            value  = math.fabs(test_y[i]- temp[i])/temp[i] 
    677684            self.assert_(value < 0.001)                 
    678                        
  • test/sasinvariant/test/utest_use_cases.py

    rb09095a rf53d684  
    44""" 
    55#TODO: there's no test for smeared extrapolation 
     6 
     7import os.path 
    68import unittest 
    79from sas.sascalc.dataloader.loader import  Loader 
     
    911 
    1012 
     13def find(filename): 
     14    return os.path.join(os.path.dirname(__file__), filename) 
     15 
     16 
    1117class Data1D: 
    1218    pass 
     
    1824    """ 
    1925    def setUp(self): 
    20         self.data_list = Loader().load("linefittest.txt") 
     26        self.data_list = Loader().load(find("linefittest.txt")) 
    2127        self.data = self.data_list[0] 
    2228 
     
    5763    """ 
    5864    def setUp(self): 
    59         self.data_list = Loader().load("linefittest_no_weight.txt") 
     65        self.data_list = Loader().load(find("linefittest_no_weight.txt")) 
    6066        self.data = self.data_list[0] 
    6167 
     
    96102    """ 
    97103    def setUp(self): 
    98         self.data_list = Loader().load("PolySpheres.txt") 
     104        self.data_list = Loader().load(find("PolySpheres.txt")) 
    99105        self.data = self.data_list[0] 
    100106 
     
    278284    def setUp(self): 
    279285        # data with smear info 
    280         list = Loader().load("latex_smeared.xml") 
     286        list = Loader().load(find("latex_smeared.xml")) 
    281287        self.data_q_smear = list[0] 
    282288 
Note: See TracChangeset for help on using the changeset viewer.