def test_should_fail_if_range_size_below_zero(self): with self.assertRaisesRegexp( GroupByException, "Invalid range_size value: -1, must be greater than 0."): ValueGroupBy.from_arguments(-1)
def test_should_fail_if_range_size_not_int(self): with self.assertRaisesRegexp( GroupByException, "Invalid range_size type: <type 'str'>, must be int."): ValueGroupBy.from_arguments('not_int')
def test_from_arguments(self): group_by = ValueGroupBy.from_arguments(500) self.assertEqual(group_by.range_size, 500)
def test_should_fail_if_range_size_below_zero(self): with self.assertRaisesRegexp(GroupByException, "Invalid range_size value: -1, must be greater than 0."): ValueGroupBy.from_arguments(-1)
def test_should_fail_if_range_size_not_int(self): with self.assertRaisesRegexp(GroupByException, "Invalid range_size type: <type 'str'>, must be int."): ValueGroupBy.from_arguments('not_int')