@@ -0,0 +1,1251 @@
+'''%0ACreated on Jul 16, 2014%0A%0A@author: thomas%0A'''%0Aimport unittest%0A%0Aclass TestPowerFrequency (unittest.TestCase):%0A%0A%0A    def setUp(self):%0A        pass%0A%0A%0A    def tearDown(self):%0A        pass%0A%0A%0A    def test_strToXTArray (self):%0A        %0A        import astroplpython.data.PowerFrequencyMeasurement as PF%0A        %0A        # test data strarr has combination of integer, floats.%0A        #%0A        strarr = %5B'(1,1)', '(2,2.)', '(2.1,3.)', '(2.018,4.)'%5D%0A        p_f_list = PF.p_f.dbStrToArray(strarr)%0A        #print (str(p_f_list))%0A        %0A        self.assertEqual(4, len(p_f_list), %22list has right number of elements%22)%0A        %0A        # Check class, return values. In checking values be sure%0A        # to check that we cast back to float%0A        x = %5B1., 2.0, 2.1, 2.018%5D%0A        t = %5B1.000, 2.0, 3.0, 4.0%5D%0A        i = 0%0A        while (i %3C 4): %0A            self.assertIsInstance(p_f_list%5Bi%5D, PF.p_f, %22is class of PowerFrequency%22)%0A            self.assertEquals(x%5Bi%5D, p_f_list%5Bi%5D.power, %22 power value is correct%22)%0A            self.assertEquals(t%5Bi%5D, p_f_list%5Bi%5D.frequency, %22freq value is correct%22)%0A            i += 1%0A%0A        self.assertEqual(str(p_f_list%5B0%5D), %22p_f(p:1.0 f:1.0)%22, %22String rep is correct%22)%0A        %0Aif __name__ == %22__main__%22:%0A    unittest.main()

Add unit tests for PowerFreqMeasurement and increase