Ignore:
Timestamp:
Apr 17, 2017 2:39:50 PM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
8ffafd1
Parents:
beba407
git-author:
Jeff Krzywon <krzywon@…> (04/17/17 14:39:50)
git-committer:
krzywon <krzywon@…> (04/17/17 14:39:50)
Message:

Refactor ASCII reader to use FileReader? class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/sascalculator/test/utest_slit_length_calculator.py

    r959eb01 rb09095a  
    55import unittest 
    66from sas.sascalc.dataloader.readers.ascii_reader import Reader 
    7 from  sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator as calculator 
     7from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator \ 
     8    as calculator 
    89 
    9 import os.path 
    1010 
    11 class slit_calculator(unittest.TestCase): 
     11class SlitCalculator(unittest.TestCase): 
    1212     
    1313    def setUp(self): 
     
    1515        self.reader = Reader() 
    1616         
    17     def test_slitlength_calculation(self): 
     17    def test_slit_length_calculation(self): 
    1818        """ 
    1919            Test slit_length_calculator" 
    2020        """ 
    21         f = self.reader.read("beam profile.DAT") 
     21        list = self.reader.read("beam profile.DAT") 
     22        self.assertTrue(len(list) == 1) 
     23        f = list[0] 
    2224        cal = calculator() 
    2325        cal.set_data(f.x,f.y) 
    24         slitlength = cal.calculate_slit_length() 
     26        slit_length = cal.calculate_slit_length() 
    2527         
    2628        # The value "5.5858" was obtained by manual calculation. 
    2729        # It turns out our slit length is FWHM/2 
    28         self.assertAlmostEqual(slitlength,5.5858/2, 3) 
     30        self.assertAlmostEqual(slit_length, 5.5858/2, 3) 
    2931         
    3032         
Note: See TracChangeset for help on using the changeset viewer.