X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=test%2FtestPeak.py;fp=test%2FtestPeak.py;h=cba620ec955682e56ebea2561c1d02228aaf200c;hp=0000000000000000000000000000000000000000;hb=0d3e3112fd04c2e6b44a25cacef1d591658ad181;hpb=5e4ae21098dba3d1edcf11e7279da0d84c3422e4 diff --git a/test/testPeak.py b/test/testPeak.py new file mode 100644 index 0000000..cba620e --- /dev/null +++ b/test/testPeak.py @@ -0,0 +1,52 @@ +''' +Created on Oct 29, 2010 + +@author: sau +''' +import unittest +from array import array +from erange import Peak + + +class TestPeak(unittest.TestCase): + + + def setUp(self): + pass + + + def tearDown(self): + pass + + + def testInitPeak(self): + topPos = 1 + numHits = 2 + smoothArray = array("f", [0.] * 10) + numPlus = 3 + peak = Peak.Peak(topPos, numHits, smoothArray, numPlus) + self.assertEquals(1, peak.topPos) + self.assertEquals(2, peak.numHits) + + def testProperties(self): + topPos = 1 + numHits = 2 + smoothArray = array("f", [0.] * 10) + numPlus = 3 + peak = Peak.Peak(topPos, numHits, smoothArray, numPlus) + peak.topPos = 10 + self.assertEquals(10, peak.topPos) + peak.numHits = 20 + self.assertEquals(20, peak.numHits) + + +def suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestPeak)) + + return suite + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() \ No newline at end of file