class RandEnumKeys(RandEnum): """Picks a random value from dict keys list. Used for fuzzing enum fields. """ def __init__(self, enum): self.enum = [] for key in list(enum.keys()): self.enum.append(key) self.seq = RandomEnumeration(0, len(list(enum.keys())) - 1) def _fix(self): return self.enum[self.seq.next()]
def __init__(self, enum): self.enum = [] for key in list(enum.keys()): self.enum.append(key) self.seq = RandomEnumeration(0, len(list(enum.keys())) - 1)