def generate_inputs(cls): things = generate_list(str) to_find = generate_string() things += [to_find] * random.randint(1, 3) random.shuffle(things) return dict( things=things, to_find=to_find, )
def generate_inputs(cls): contained = random.choice([True, False]) things = generate_list(int) if contained: thing_to_find = random.choice(things) else: thing_to_find = random.choice([ min(things) - 1, max(things) + 1, ]) return dict( things=things, thing_to_find=thing_to_find, )