コード例 #1
0
    def test_fix_exponent(self):

        test_out_dir = self.set_outputfolder("test_fix_exponent")


        ag = AGAnalysis(self.agilepyConf, self.sourcesConfTxt)

        self.assertEqual('894.587e-08', ag._fixToNegativeExponent(8.94587e-06, fixedExponent=-8))
        self.assertEqual('309.757e-08', ag._fixToNegativeExponent(3.09757e-06, fixedExponent=-8))
        self.assertEqual('1623.16e-08', ag._fixToNegativeExponent(1.62316e-05, fixedExponent=-8))
        self.assertEqual('1.524e-08', ag._fixToNegativeExponent(1.524e-8, fixedExponent=-8))
        self.assertEqual('1.524e+18e-08', ag._fixToNegativeExponent(1.524e10, fixedExponent=-8))
        self.assertEqual('0.0', ag._fixToNegativeExponent(0.0, fixedExponent=-8))

        ag.destroy()
コード例 #2
0
    def test_fix_exponent(self):

        ag = AGAnalysis(self.agilepyconfPath, self.sourcesconfPathcalcBkg)

        self.assertEqual(
            '894.587e-08',
            ag._fixToNegativeExponent(8.94587e-06, fixedExponent=-8))
        self.assertEqual(
            '309.757e-08',
            ag._fixToNegativeExponent(3.09757e-06, fixedExponent=-8))
        self.assertEqual(
            '1623.16e-08',
            ag._fixToNegativeExponent(1.62316e-05, fixedExponent=-8))
        self.assertEqual('1.524e-08',
                         ag._fixToNegativeExponent(1.524e-8, fixedExponent=-8))
        self.assertEqual('1.524e+18e-08',
                         ag._fixToNegativeExponent(1.524e10, fixedExponent=-8))
        self.assertEqual('0.0', ag._fixToNegativeExponent(0.0,
                                                          fixedExponent=-8))