the emblematic types to use to generate test data for. defaults to empty
custom generation functions. defaults to empty. custom generators take precedence over all other generators
generates a boolean that is true around half the time
generates a boolean that is true around half the time
generates a char that is either a decimal digit or a letter (upper or lowercase) from the Roman alphabet
generates a char that is either a decimal digit or a letter (upper or lowercase) from the Roman alphabet
generates a type key for the union constituent
generates a type key for the union constituent
the type of the Union object to traverse
the union
the constituent type key
custom generation functions.
custom generation functions. defaults to empty. custom generators take precedence over all other generators
generates a date-time
generates a date-time
generates a double
generates a double
the emblematic types to use to generate test data for.
the emblematic types to use to generate test data for. defaults to empty
generates a float
generates a float
generates data for the specified type A
generates data for the specified type A
the type of data to generate
the generated data
emblem.exceptions.CouldNotGenerateException
when we encounter a type in the recursive traversal
that we don't know how to generate for
generates an int
generates an int
returns the size of the list to be generated.
returns the size of the list to be generated. a negative return value will result in an empty list.
the type of the list elements
generates a long
generates a long
returns the size of the option to be generated.
returns the size of the option to be generated. a return value of 0
will
generate a None
, and a return value of 1
(or anything other than 0
)
will generate a Some
.
the type of the optional value
returns the size of the set to be generated.
returns the size of the set to be generated. a negative return value will result in an empty set.
the type of the set elements
generates a string of the specified length
generates a string of length 8
generates a string of length 8
generates test data for a pool of extractors, a pool of emblems, and some custom generators. you can generate any kind of data you like by providing the appropriate TypeKey to TestDataGenerator.generate. or you can use the provided methods for generating specific kinds of data. if the generator does not know how to generate for the type you requested, it will throw a emblem.exceptions.CouldNotGenerateException.
out of the box, a TestDataGenerator knows how to generate the following basic and collection types:
you can extend this behavior by supplying the generator with an Emblematic and custom generators.