class slit_calculator(unittest.TestCase): def setUp(self): self.reader = Reader() def test_slitlength_calculation(self): """ Test slit_length_calculator" """ f = self.reader.read("beam profile.DAT") cal = calculator() cal.set_data(f.x, f.y) slitlength = cal.calculate_slit_length() # The value "5.5858" was obtained by manual calculation. # It turns out our slit length is FWHM/2 self.assertAlmostEqual(slitlength, 5.5858 / 2, 3)
class slit_calculator(unittest.TestCase): def setUp(self): self.reader = Reader() def test_slitlength_calculation(self): """ Test slit_length_calculator" """ f = self.reader.read("beam profile.DAT") cal = calculator() cal.set_data(f.x,f.y) slitlength = cal.calculate_slit_length() # The value "5.5858" was obtained by manual calculation. # It turns out our slit length is FWHM/2 self.assertAlmostEqual(slitlength,5.5858/2, 3)
def setUp(self): self.reader = Reader()