def GenObj(): obj_num = random.randint(100, 1000) bad_obj_num = random.randint(obj_num / 100, obj_num / 20) if bad_obj_num == 0: bad_obj_num = 1 gen_obj.Main( ['--obj_num', str(obj_num), '--bad_obj_num', str(bad_obj_num)])
def test_every_obj_bad(self): amt = 25 gen_obj.Main(['--obj_num', str(amt), '--bad_obj_num', str(amt)]) ret = binary_search_state.Run(get_initial_items='./gen_init_list.py', switch_to_good='./switch_to_good.py', switch_to_bad='./switch_to_bad.py', test_script='./is_good.py', prune=True, file_args=True, verify=False) self.assertEquals(ret, 0) self.check_output()
def test_every_index_is_bad(self): amt = 25 for i in range(amt): obj_list = ['0'] * amt obj_list[i] = '1' obj_list = ','.join(obj_list) gen_obj.Main(['--obj_list', obj_list]) ret = binary_search_state.Run( get_initial_items='./gen_init_list.py', switch_to_good='./switch_to_good.py', switch_to_bad='./switch_to_bad.py', test_setup_script='./test_setup.py', test_script='./is_good.py', prune=True, file_args=True) self.assertEquals(ret, 0) self.check_output()