def test_threshold_factory(self):
    alg = trivial.threshold_factory(300, 20.0, {'threshold': 0.5})
    self.assertEqual(alg([]), (False, {}))
    self.assertEqual(alg([0.0, 0.0]), (True, {}))
    self.assertEqual(alg([0.0, 0.4]), (True, {}))
    self.assertEqual(alg([0.0, 0.5]), (True, {}))
    self.assertEqual(alg([0.0, 0.6]), (False, {}))
    self.assertEqual(alg([0.0, 1.0]), (False, {}))
def test_threshold_factory(self):
    alg = trivial.threshold_factory(300, 20.0, {'threshold': 0.5})
    self.assertEqual(alg([]), (False, {}))
    self.assertEqual(alg([0.0, 0.0]), (True, {}))
    self.assertEqual(alg([0.0, 0.4]), (True, {}))
    self.assertEqual(alg([0.0, 0.5]), (True, {}))
    self.assertEqual(alg([0.0, 0.6]), (False, {}))
    self.assertEqual(alg([0.0, 1.0]), (False, {}))