def test_ma(self): lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0, function=self.func) self.assertTrue(is_lazy_data(lazy_data)) self.assertArrayEqual(lazy_data.compute(), [2])
def test_lazy(self): lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0, function=self.func) self.assertTrue(is_lazy_data(lazy_data))
def test_lazy_collapse(self): lazy_data = COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0, function=self.func) self.assertArrayEqual(lazy_data.compute(), [3])
def test_no_function(self): exp_emsg = r"function must be a callable. Got <.* 'NoneType'>" with self.assertRaisesRegex(TypeError, exp_emsg): COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0)
def test_lazy_not_callable(self): with self.assertRaisesRegex(TypeError, 'function must be a callable'): COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0, function='wibble')
def test_lazy_not_callable(self): with self.assertRaisesRegexp(TypeError, 'function must be a callable'): COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0, function='wibble')
def test_no_function(self): exp_emsg = r"function must be a callable. Got <.* 'NoneType'>" with self.assertRaisesRegexp(TypeError, exp_emsg): COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0)