source: sasview/calculator/test/utest_slit_length_calculator.py @ d267aed

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since d267aed was 0bf2c6f, checked in by Jae Cho <jhjcho@…>, 15 years ago

slit length calculator and sample data and unit test: GUI is not done yet

  • Property mode set to 100644
File size: 822 bytes
Line 
1"""
2    Unit tests for slit_length_calculator
3"""
4
5import unittest
6from DataLoader.readers.ascii_reader import Reader
7from  sans.calculator.slit_length_calculator import SlitlengthCalculator as calculator
8
9import os.path
10
11class slit_calculator(unittest.TestCase):
12   
13    def setUp(self):
14       
15        self.reader = Reader()
16       
17    def test_slitlength_calculation(self):
18        """
19            Test slit_length_calculator"
20        """
21        f = self.reader.read("beam profile.DAT")
22        cal = calculator()
23        cal.set_data(f.x,f.y)
24        slitlength = cal.get_slit_length()
25       
26        # The value "5.5858" was obtained by manual calculation.
27        self.assertAlmostEqual(slitlength,5.5858, 3)
28       
29       
30if __name__ == '__main__':
31    unittest.main()
32   
Note: See TracBrowser for help on using the repository browser.