Changeset 35ec279 in sasview for test


Ignore:
Timestamp:
Feb 13, 2015 4:08:43 AM (10 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.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:
b9a5f0e
Parents:
8c9ffde
Message:

Completed the SANS to SAS conversion on the tests. src.sas is left.

Location:
test
Files:
24 edited
1 moved

Legend:

Unmodified
Added
Removed
  • test/README.rst

    r6c00702 r35ec279  
    99only need to rebuild between tests if you are modifying the C code. 
    1010 
    11 Tests can be run in Eclipse (or other IDE) by selecting *utest_sansview.py* 
     11Tests can be run in Eclipse (or other IDE) by selecting *utest_sasview.py* 
    1212and selecting run.  This will run all of the tests.  To run tests for one 
    13 one package, edit the *utest_sansview.py* run command and add the package 
     13one package, edit the *utest_sasview.py* run command and add the package 
    1414directory to the command arguments.  To run an individual test, 
    1515select *run_one.py* and edit the command arguments to include the path to 
  • test/calculatorview/test/utest_gui_sld.py

    r5777106 r35ec279  
    1919        """ 
    2020        self.app = wx.App() 
    21         from sans.perspectives.calculator.sld_panel import SldWindow 
     21        from sas.perspectives.calculator.sld_panel import SldWindow 
    2222        self.sld_frame = SldWindow() 
    2323        
  • test/park_integration/test/batch_fit.py

    re3efa6b3 r35ec279  
    22import time 
    33import unittest 
    4 from sans.dataloader.loader import Loader 
    5 from sans.fit.Fitting import Fit 
    6 from sans.models.CylinderModel import CylinderModel 
    7 import sans.models.dispersion_models  
    8 from sans.models.qsmearing import smear_selection 
     4from sas.dataloader.loader import Loader 
     5from sas.fit.Fitting import Fit 
     6from sas.models.CylinderModel import CylinderModel 
     7import sas.models.dispersion_models  
     8from sas.models.qsmearing import smear_selection 
    99 
    1010NPTS = 1 
     
    3333        self.list_of_constraints = [] 
    3434        self.list_of_mapper = [] 
    35         self.polydisp = sans.models.dispersion_models.models 
     35        self.polydisp = sas.models.dispersion_models.models 
    3636        self.qmin = qmin 
    3737        self.qmax = qmin 
  • test/park_integration/test/utest_fit_cylinder.py

    reff93b8 r35ec279  
    66import math 
    77 
    8 from sans.fit.AbstractFitEngine import Model 
    9 from sans.fit.Fitting import Fit 
    10 from sans.dataloader.loader import Loader 
     8from sas.fit.AbstractFitEngine import Model 
     9from sas.fit.Fitting import Fit 
     10from sas.dataloader.loader import Loader 
    1111 
    1212#@unittest.skip("") 
     
    1717        self.data = Loader().load("cyl_400_20.txt") 
    1818        # Create model that fitting engine understands 
    19         from sans.models.CylinderModel import CylinderModel 
     19        from sas.models.CylinderModel import CylinderModel 
    2020        self.model  = CylinderModel() 
    2121        self.model.setParam("scale", 1.0) 
     
    7070     
    7171        # Receives the type of model for the fitting 
    72         from sans.models.CylinderModel import CylinderModel 
     72        from sas.models.CylinderModel import CylinderModel 
    7373        cyl1  = CylinderModel() 
    7474        cyl1.name = "C1" 
  • test/park_integration/test/utest_fit_line.py

    re3efa6b3 r35ec279  
    66import math 
    77 
    8 from sans.fit.AbstractFitEngine import Model, FitHandler 
    9 from sans.dataloader.loader import Loader 
    10 from sans.fit.Fitting import Fit 
    11 from sans.models.LineModel import LineModel 
    12 from sans.models.Constant import Constant 
     8from sas.fit.AbstractFitEngine import Model, FitHandler 
     9from sas.dataloader.loader import Loader 
     10from sas.fit.Fitting import Fit 
     11from sas.models.LineModel import LineModel 
     12from sas.models.Constant import Constant 
    1313 
    1414class testFitModule(unittest.TestCase): 
  • test/park_integration/test/utest_fit_smeared.py

    re3efa6b3 r35ec279  
    77 
    88import numpy 
    9 from sans.fit.AbstractFitEngine import Model 
    10 from sans.fit.Fitting import Fit 
    11 from sans.dataloader.loader import Loader 
    12 from sans.models.qsmearing import smear_selection 
    13 from sans.models.CylinderModel import CylinderModel 
    14 from sans.models.SphereModel import SphereModel 
     9from sas.fit.AbstractFitEngine import Model 
     10from sas.fit.Fitting import Fit 
     11from sas.dataloader.loader import Loader 
     12from sas.models.qsmearing import smear_selection 
     13from sas.models.CylinderModel import CylinderModel 
     14from sas.models.SphereModel import SphereModel 
    1515 
    1616class testFitModule(unittest.TestCase): 
     
    157157 
    158158        # Model: maybe there's a better way to do this. 
    159         # Ideally we should have to create a new model from our sans model. 
     159        # Ideally we should have to create a new model from our sas model. 
    160160        fitter.set_model(Model(self.sphere),1, ['radius','scale', 'background']) 
    161161         
  • test/park_integration/test/utest_park_scipy.py

    re544c84 r35ec279  
    66import math 
    77 
    8 from sans.guiframe.dataFitting import Data1D  
    9 from sans.fit.AbstractFitEngine import Model,FitData1D 
    10 from sans.fit.Fitting import Fit 
    11 from sans.dataloader.loader import Loader 
    12 from sans.models.MultiplicationModel import MultiplicationModel 
    13 from sans.models.CylinderModel import CylinderModel 
    14 from sans.models.SquareWellStructure import SquareWellStructure 
     8from sas.guiframe.dataFitting import Data1D  
     9from sas.fit.AbstractFitEngine import Model,FitData1D 
     10from sas.fit.Fitting import Fit 
     11from sas.dataloader.loader import Loader 
     12from sas.models.MultiplicationModel import MultiplicationModel 
     13from sas.models.CylinderModel import CylinderModel 
     14from sas.models.SquareWellStructure import SquareWellStructure 
    1515 
    1616class testFitModule(unittest.TestCase): 
  • test/park_integration/test/utest_small_test.py

    r76f132a r35ec279  
    44import unittest 
    55import math 
    6 from sans.fit.Fitting import Fit 
    7 from sans.dataloader.loader import Loader 
     6from sas.fit.Fitting import Fit 
     7from sas.dataloader.loader import Loader 
    88 
    99class testFitModule(unittest.TestCase): 
     
    1616        fitter = Fit('scipy') 
    1717        # Receives the type of model for the fitting 
    18         from sans.models.CylinderModel import CylinderModel 
     18        from sas.models.CylinderModel import CylinderModel 
    1919        model  = CylinderModel() 
    2020        model.setParam('sldCyl', 1) 
  • test/pr_inversion/test/test_module.py

    r5777106 r35ec279  
    1 from sans.pr.core.pr_inversion import Cinvertor 
     1from sas.pr.core.pr_inversion import Cinvertor 
    22import numpy 
    33 
  • test/pr_inversion/test/utest_explorer.py

    r5777106 r35ec279  
    55import unittest, math, numpy 
    66from utest_invertor import load 
    7 from sans.pr.invertor import Invertor 
    8 from sans.pr.distance_explorer import DistExplorer 
     7from sas.pr.invertor import Invertor 
     8from sas.pr.distance_explorer import DistExplorer 
    99         
    1010class TestExplorer(unittest.TestCase): 
  • test/pr_inversion/test/utest_invertor.py

    r95fb3e8 r35ec279  
    99 
    1010import unittest, math, numpy 
    11 from sans.pr.invertor import Invertor 
     11from sas.pr.invertor import Invertor 
    1212         
    1313class TestFiguresOfMerit(unittest.TestCase): 
  • test/sascalculator/test/utest_resolution_calculator.py

    r8c9ffde r35ec279  
    44 
    55import unittest 
    6 from  sans.calculator.resolution_calculator import ResolutionCalculator \ 
     6from  sas.calculator.resolution_calculator import ResolutionCalculator \ 
    77                                            as calculator 
    88 
  • test/sascalculator/test/utest_sans_gen.py

    r8c9ffde r35ec279  
    11""" 
    2 Unit tests for the sans_gen 
     2Unit tests for the sas_gen 
    33""" 
    44import warnings 
     
    66 
    77import unittest 
    8 from sans.calculator import sans_gen 
    9 from sans.models.SphereModel import SphereModel 
     8from sas.calculator import sas_gen 
     9from sas.models.SphereModel import SphereModel 
    1010 
    1111import numpy 
     
    1313import os.path 
    1414 
    15 class sans_gen_test(unittest.TestCase): 
     15class sas_gen_test(unittest.TestCase): 
    1616     
    1717    def setUp(self): 
    18         self.sldloader = sans_gen.SLDReader() 
    19         self.pdbloader = sans_gen.PDBReader() 
    20         self.omfloader = sans_gen.OMFReader()  
     18        self.sldloader = sas_gen.SLDReader() 
     19        self.pdbloader = sas_gen.PDBReader() 
     20        self.omfloader = sas_gen.OMFReader()  
    2121        self.comp = SphereModel() 
    2222         
     
    4444        """ 
    4545        f = self.omfloader.read("A_Raw_Example-1.omf") 
    46         output = sans_gen.OMF2SLD() 
     46        output = sas_gen.OMF2SLD() 
    4747        output.set_data(f) 
    4848        self.assertEqual(f.mx[0], 0) 
     
    5757        sld_data = self.sldloader.read("sphere697_r30.sld") 
    5858        # Generic computation   
    59         model = sans_gen.GenSAS() 
     59        model = sas_gen.GenSAS() 
    6060        model.setParam('background', 0.0) 
    6161        model.setParam('scale', 1.0) 
  • test/sascalculator/test/utest_slit_length_calculator.py

    r8c9ffde r35ec279  
    44 
    55import unittest 
    6 from sans.dataloader.readers.ascii_reader import Reader 
    7 from  sans.calculator.slit_length_calculator import SlitlengthCalculator as calculator 
     6from sas.dataloader.readers.ascii_reader import Reader 
     7from  sas.calculator.slit_length_calculator import SlitlengthCalculator as calculator 
    88 
    99import os.path 
  • test/sasdataloader/plugins/test_reader.py

    r8c9ffde r35ec279  
    99""" 
    1010import numpy, os 
    11 from sans.dataloader.data_info import Data1D 
     11from sas.dataloader.data_info import Data1D 
    1212 
    1313 
  • test/sasdataloader/test/error_conditions.py

    r8c9ffde r35ec279  
    1 from sans.dataloader.loader import Loader 
     1from sas.dataloader.loader import Loader 
    22import unittest 
    33 
  • test/sasdataloader/test/testLoad.py

    r8c9ffde r35ec279  
    1414import unittest 
    1515import math 
    16 import sans.dataloader 
    17 from sans.dataloader.loader import  Loader 
     16import sas.dataloader 
     17from sas.dataloader.loader import  Loader 
    1818 
    1919# Check whether we should test image loading on this system  
  • test/sasdataloader/test/testplugings.py

    r8c9ffde r35ec279  
    44 
    55import unittest 
    6 from sans.dataloader.loader import  Loader, Registry 
     6from sas.dataloader.loader import  Loader, Registry 
    77class testLoader(unittest.TestCase): 
    88     
  • test/sasdataloader/test/utest_abs_reader.py

    r8c9ffde r35ec279  
    55import unittest 
    66import numpy, math 
    7 from sans.dataloader.loader import  Loader 
    8 from sans.dataloader.data_info import Data1D 
     7from sas.dataloader.loader import  Loader 
     8from sas.dataloader.data_info import Data1D 
    99  
    1010import os.path 
     
    1313     
    1414    def setUp(self): 
    15         from sans.dataloader.readers.abs_reader import Reader 
     15        from sas.dataloader.readers.abs_reader import Reader 
    1616        self.data = Reader().read("jan08002.ABS") 
    1717         
     
    311311         
    312312    def test_writer(self): 
    313         from sans.dataloader.readers.cansas_reader import Reader 
     313        from sas.dataloader.readers.cansas_reader import Reader 
    314314        r = Reader() 
    315315        x = numpy.ones(5) 
  • test/sasdataloader/test/utest_ascii.py

    r8c9ffde r35ec279  
    66 
    77import unittest 
    8 from sans.dataloader.loader import  Loader 
     8from sas.dataloader.loader import  Loader 
    99  
    1010import os.path 
  • test/sasdataloader/test/utest_averaging.py

    r8c9ffde r35ec279  
    22import unittest 
    33 
    4 from sans.dataloader.loader import  Loader 
    5 from sans.dataloader.manipulations import Ring, CircularAverage, SectorPhi, get_q,reader2D_converter 
     4from sas.dataloader.loader import  Loader 
     5from sas.dataloader.manipulations import Ring, CircularAverage, SectorPhi, get_q,reader2D_converter 
    66  
    77import os.path 
    88import numpy, math 
    9 import sans.dataloader.data_info as data_info 
     9import sas.dataloader.data_info as data_info 
    1010 
    1111class Averaging(unittest.TestCase): 
     
    137137            The test data was not generated by IGOR. 
    138138        """ 
    139         from sans.dataloader.manipulations import Boxsum, Boxavg 
     139        from sas.dataloader.manipulations import Boxsum, Boxavg 
    140140         
    141141        r = Boxsum(x_min=.01, x_max=.015, y_min=0.01, y_max=0.015) 
     
    155155            The test data was not generated by IGOR. 
    156156        """ 
    157         from sans.dataloader.manipulations import SlabX 
     157        from sas.dataloader.manipulations import SlabX 
    158158         
    159159        r = SlabX(x_min=-.01, x_max=.01, y_min=-0.0002, y_max=0.0002, bin_width=0.0004) 
     
    172172            The test data was not generated by IGOR. 
    173173        """ 
    174         from sans.dataloader.manipulations import SlabY 
     174        from sas.dataloader.manipulations import SlabY 
    175175         
    176176        r = SlabY(x_min=.005, x_max=.01, y_min=-0.01, y_max=0.01, bin_width=0.0004) 
     
    191191            The test data was not generated by IGOR. 
    192192        """ 
    193         from sans.dataloader.manipulations import SectorPhi 
     193        from sas.dataloader.manipulations import SectorPhi 
    194194        import math 
    195195         
     
    209209            The test data was not generated by IGOR. 
    210210        """ 
    211         from sans.dataloader.manipulations import SectorPhi 
     211        from sas.dataloader.manipulations import SectorPhi 
    212212        import math 
    213213         
     
    227227            The test data was not generated by IGOR. 
    228228        """ 
    229         from sans.dataloader.manipulations import SectorQ 
     229        from sas.dataloader.manipulations import SectorQ 
    230230        import math 
    231231         
  • test/sasdataloader/test/utest_cansas.py

    r8c9ffde r35ec279  
    66warnings.simplefilter("ignore") 
    77 
    8 import sans.dataloader.readers.cansas_reader as cansas 
    9 from sans.dataloader.loader import Loader 
    10 from sans.dataloader.data_info import Data1D 
    11 from sans.dataloader.readers.xml_reader import XMLreader 
    12 from sans.dataloader.readers.cansas_reader import Reader 
    13 from sans.dataloader.readers.cansas_constants import CansasConstants 
     8import sas.dataloader.readers.cansas_reader as cansas 
     9from sas.dataloader.loader import Loader 
     10from sas.dataloader.data_info import Data1D 
     11from sas.dataloader.readers.xml_reader import XMLreader 
     12from sas.dataloader.readers.cansas_reader import Reader 
     13from sas.dataloader.readers.cansas_constants import CansasConstants 
    1414 
    1515import os 
  • test/sasdataloader/test/utest_red2d_reader.py

    r8c9ffde r35ec279  
    66 
    77import unittest 
    8 from sans.dataloader.loader import  Loader 
     8from sas.dataloader.loader import  Loader 
    99  
    1010import os.path 
  • test/sasguiframe/test/utest_manipulations.py

    r8c9ffde r35ec279  
    66import unittest 
    77import numpy, math 
    8 from sans.dataloader.loader import  Loader 
    9 from sans.guiframe.dataFitting import Data1D, Data2D 
    10 from sans.guiframe.dataFitting import Data1D as Theory1D 
     8from sas.dataloader.loader import  Loader 
     9from sas.guiframe.dataFitting import Data1D, Data2D 
     10from sas.guiframe.dataFitting import Data1D as Theory1D 
    1111  
    1212import os.path 
  • test/utest_sasview.py

    r95fb3e8 r35ec279  
    1919    HAS_MPL_WX = False 
    2020 
    21 SKIPPED_DIRS = ["sansrealspace", "calculatorview"] 
     21SKIPPED_DIRS = ["sasrealspace", "calculatorview"] 
    2222if not HAS_MPL_WX: 
    23     SKIPPED_DIRS.append("sansguiframe") 
     23    SKIPPED_DIRS.append("sasguiframe") 
    2424 
    2525#COMMAND_SEP = ';' 
Note: See TracChangeset for help on using the changeset viewer.