Esempio n. 1
0
 def test_missing_mandatory_kwarg(self):
     emsg = "percentile aggregator requires .* keyword argument 'percent'"
     with self.assertRaisesRegexp(ValueError, emsg):
         PERCENTILE.aggregate_shape()
     with self.assertRaisesRegexp(ValueError, emsg):
         kwargs = dict()
         PERCENTILE.aggregate_shape(**kwargs)
     with self.assertRaisesRegexp(ValueError, emsg):
         kwargs = dict(point=10)
         PERCENTILE.aggregate_shape(**kwargs)
Esempio n. 2
0
 def test_missing_mandatory_kwarg(self):
     emsg = "percentile aggregator requires .* keyword argument 'percent'"
     with self.assertRaisesRegexp(ValueError, emsg):
         PERCENTILE.aggregate_shape()
     with self.assertRaisesRegexp(ValueError, emsg):
         kwargs = dict()
         PERCENTILE.aggregate_shape(**kwargs)
     with self.assertRaisesRegexp(ValueError, emsg):
         kwargs = dict(point=10)
         PERCENTILE.aggregate_shape(**kwargs)
Esempio n. 3
0
 def test_mandatory_kwarg_shape(self):
     kwargs = dict(percent=(10, 20))
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), (2,))
     kwargs = dict(percent=list(range(13)))
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), (13,))
Esempio n. 4
0
 def test_mandatory_kwarg_no_shape(self):
     kwargs = dict(percent=50)
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), ())
     kwargs = dict(percent=[50])
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), ())
Esempio n. 5
0
 def test_mandatory_kwarg_shape(self):
     kwargs = dict(percent=(10, 20))
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), (2,))
     kwargs = dict(percent=list(range(13)))
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), (13,))
Esempio n. 6
0
 def test_mandatory_kwarg_no_shape(self):
     kwargs = dict(percent=50)
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), ())
     kwargs = dict(percent=[50])
     self.assertTupleEqual(PERCENTILE.aggregate_shape(**kwargs), ())