def check_range_multiple_random_shape(self, ranges): for min, max in ranges: for size in sizes: for i in range(replays): with self.subTest(): r = Range(min, max) rand = r.random(size) self.assertEqual(rand.shape, (size, 1), 'Random wrong shape')
def check_range_multiple_random_range(self, ranges): for min, max in ranges: for size in sizes: for i in range(replays): with self.subTest(): r = Range(min, max) rand = r.random(size) self.assertTrue(np.alltrue(min <= rand) and np.alltrue(rand <= max), 'Random not in range')
def _check_range_random_type(self, ranges, t): for min, max in ranges: for i in range(replays): with self.subTest(): r = Range(min, max) self.assertIsInstance(r.random(), t, 'Random wrong type')
def _check_range_single_random_range(self, ranges): for min, max in ranges: for i in range(replays): with self.subTest(): r = Range(min, max) self.assertTrue(min <= r.random() <= max, 'Random not in range')