From 990bfaf44ce39aaa01a2107aadc1933947bcf550 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 4 Oct 2013 10:52:26 -0700 Subject: Added FuzzyText attribute. Useful for unique model attributes where the specific value can be fuzzy. --- docs/fuzzy.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'docs') diff --git a/docs/fuzzy.rst b/docs/fuzzy.rst index d88cb5a..582a654 100644 --- a/docs/fuzzy.rst +++ b/docs/fuzzy.rst @@ -24,6 +24,35 @@ FuzzyAttribute The callable that generates random values +FuzzyText +--------- + + +.. class:: FuzzyText(length=12, chars=string.ascii_letters, prefix='') + + The :class:`FuzzyText` fuzzer yields random strings beginning with + the given :attr:`prefix`, followed by :attr:`length` charactes chosen + from the :attr:`chars` character set, + and ending with the given :attr:`suffix`. + + .. attribute:: length + + int, the length of the random part + + .. attribute:: prefix + + text, an optional prefix to prepend to the random part + + .. attribute:: suffix + + text, an optional suffix to append to the random part + + .. attribute:: chars + + char iterable, the chars to choose from; defaults to the list of ascii + letters and numbers. + + FuzzyChoice ----------- -- cgit v1.2.3