Ejemplo n.º 1
0
  def test(self):
    self.assertEqual(impexpd._CalcThroughput([]), None)
    self.assertEqual(impexpd._CalcThroughput([(0, 0)]), None)

    samples = [
      (0.0, 0.0),
      (10.0, 100.0),
      ]
    self.assertAlmostEqual(impexpd._CalcThroughput(samples), 10.0, 3)

    samples = [
      (5.0, 7.0),
      (10.0, 100.0),
      (16.0, 181.0),
      ]
    self.assertAlmostEqual(impexpd._CalcThroughput(samples), 15.818, 3)
Ejemplo n.º 2
0
    def test(self):
        self.assertEqual(impexpd._CalcThroughput([]), None)
        self.assertEqual(impexpd._CalcThroughput([(0, 0)]), None)

        samples = [
            (0.0, 0.0),
            (10.0, 100.0),
        ]
        self.assertAlmostEqual(impexpd._CalcThroughput(samples), 10.0, 3)

        samples = [
            (5.0, 7.0),
            (10.0, 100.0),
            (16.0, 181.0),
        ]
        self.assertAlmostEqual(impexpd._CalcThroughput(samples), 15.818, 3)