def test_getRegisteredTypes(self):
     """check PeakProfile.getRegisteredTypes
     """
     regtypes = PeakProfile.getRegisteredTypes()
     self.assertTrue(2 <= len(regtypes))
     self.assertTrue(regtypes.issuperset(["gaussian", "croppedgaussian"]))
     return
Beispiel #2
0
 def test_getRegisteredTypes(self):
     """check PeakProfile.getRegisteredTypes
     """
     regtypes = PeakProfile.getRegisteredTypes()
     self.assertTrue(2 <= len(regtypes))
     self.assertTrue(regtypes.issuperset(['gaussian', 'croppedgaussian']))
     return
Beispiel #3
0
 def test_type(self):
     """check PeakProfile.type
     """
     # this is a virtual method in the base class
     self.assertRaises(RuntimeError, PeakProfile().type)
     self.assertEqual('croppedgaussian', self.pkcropped.type())
     return
Beispiel #4
0
 def test_create(self):
     """check PeakProfile.create
     """
     # this is a virtual method in the base class
     self.assertRaises(RuntimeError, PeakProfile().create)
     self.assertEqual('gaussian', self.pkgauss.create().type())
     self.pkgauss.peakprecision = 0.007
     self.assertNotEqual(0.007, self.pkgauss.create().peakprecision)
     return
Beispiel #5
0
 def test_clone(self):
     """check PeakProfile.clone
     """
     # this is a virtual method in the base class
     self.assertRaises(RuntimeError, PeakProfile().clone)
     self.pkgauss.peakprecision = 0.0003
     pkg2 = self.pkgauss.clone()
     self.assertEqual('gaussian', pkg2.type())
     self.assertEqual(0.0003, pkg2.peakprecision)
     self.assertEqual(0.0003, pkg2._getDoubleAttr('peakprecision'))
     return
Beispiel #6
0
 def test_ticker_override(self):
     """check method override for PeakProfile.ticker in a derived class.
     """
     pkf = MySawTooth()
     self.assertEqual(0, pkf.tcnt)
     et0 = pkf.ticker()
     self.assertEqual(1, pkf.tcnt)
     et1 = PeakProfile.ticker(pkf)
     self.assertEqual(1, pkf.tcnt)
     self.assertEqual(et0, et1)
     et0.click()
     self.assertEqual(et0, et1)
     # check that implicit ticker call from PDFCalculator is
     # handled by the Python ticker override.
     pc = PDFCalculator()
     pc.peakprofile = pkf
     pc.ticker()
     self.assertEqual(2, pkf.tcnt)
     return
 def test_ticker_override(self):
     """check method override for PeakProfile.ticker in a derived class.
     """
     pkf = MySawTooth()
     self.assertEqual(0, pkf.tcnt)
     et0 = pkf.ticker()
     self.assertEqual(1, pkf.tcnt)
     et1 = PeakProfile.ticker(pkf)
     self.assertEqual(1, pkf.tcnt)
     self.assertEqual(et0, et1)
     et0.click()
     self.assertEqual(et0, et1)
     # check that implicit ticker call from PDFCalculator is
     # handled by the Python ticker override.
     pc = PDFCalculator()
     pc.peakprofile = pkf
     pc.ticker()
     self.assertEqual(2, pkf.tcnt)
     return
 def setUp(self):
     self.pkgauss = PeakProfile.createByType("gaussian")
     self.pkcropped = PeakProfile.createByType("croppedgaussian")
     return
 def ticker(self):
     self.tcnt += 1
     return PeakProfile.ticker(self)
Beispiel #10
0
 def setUp(self):
     self.pkgauss = PeakProfile.createByType('gaussian')
     self.pkcropped = PeakProfile.createByType('croppedgaussian')
     return
Beispiel #11
0
 def ticker(self):
     self.tcnt += 1
     return PeakProfile.ticker(self)
 def setUp(self):
     self.pkgauss = PeakProfile.createByType('gaussian')
     self.pkcropped = PeakProfile.createByType('croppedgaussian')
     return
Beispiel #13
0
 def tearDown(self):
     PeakProfile._deregisterType(self.pkf.type())
     return
Beispiel #14
0
 def tearDown(self):
     PeakProfile._deregisterType(self.pkf.type())
     return