def test_num_boots(self): test_files = glob.glob( os.path.join(self.path, 'test_data/inject_test1/pspec*.npz')) ref_dict = read_bootstraps(test_files) in_dict = {'pIs': ref_dict['nocov_vs_t']} ref_boots = 15 out_dict = random_avg_bootstraps(in_dict, boot_axis=0, time_axis=-1, nboot=ref_boots) out_boots = np.shape(out_dict['pIs'])[0] self.assertEqual(ref_boots, out_boots)
def test_no_boot_axis_input(self): with self.assertRaises(TypeError): random_avg_bootstraps({'test': []})
def test_empty_string_input(self): with self.assertRaises(TypeError): random_avg_bootstraps('')
def test_blank_list(self): with self.assertRaises(TypeError): random_avg_bootstraps([])
def test_none_input(self): with self.assertRaises(TypeError): random_avg_bootstraps()
def test_time_axis_type(self): with self.assertRaises(TypeError): random_avg_bootstraps({'test': []}, boot_axis=1, time_axis=1.2) random_avg_bootstraps({'test': []}, boot_axis=1, time_axis=1 + 1j)