Package sulley :: Module primitives :: Class random_data
[show private | hide private]
[frames | no frames]

Type random_data

    object --+    
             |    
base_primitive --+
                 |
                random_data


Method Summary
  __init__(self, value, min_length, max_length, max_mutations, fuzzable, name)
Generate a random chunk of data while maintaining a copy of the original.
Boolean mutate(self)
Mutate the primitive value returning False on completion.
Integer num_mutations(self)
Calculate and return the total number of mutations for this individual primitive.
    Inherited from base_primitive
Integer exhaust(self)
Exhaust the possible mutations for this primitive.
  render(self)
Nothing fancy on render, simply return the value.
  reset(self)
Reset this primitive to the starting mutation state.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, value, min_length, max_length, max_mutations=25, fuzzable=True, name=None)
(Constructor)

Generate a random chunk of data while maintaining a copy of the original. A random length range can be specified. For a static length, set min/max length to be the same.
Parameters:
value - Original value
           (type=Raw)
min_length - Minimum length of random block
           (type=Integer)
max_length - Maximum length of random block
           (type=Integer)
max_mutations - (Optional, def=25) Number of mutations to make before reverting to default
           (type=Integer)
fuzzable - (Optional, def=True) Enable/disable fuzzing of this primitive
           (type=Boolean)
name - (Optional, def=None) Specifying a name gives you direct access to a primitive
           (type=String)
Overrides:
sulley.primitives.base_primitive.__init__

mutate(self)

Mutate the primitive value returning False on completion.
Returns:
True on success, False otherwise.
           (type=Boolean)
Overrides:
sulley.primitives.base_primitive.mutate

num_mutations(self)

Calculate and return the total number of mutations for this individual primitive.
Returns:
Number of mutated forms this primitive can take
           (type=Integer)
Overrides:
sulley.primitives.base_primitive.num_mutations

Generated by Epydoc 2.1 on Fri Jul 27 17:40:03 2007 http://epydoc.sf.net