FauxFactory generates random data for your automated tests easily!

Related tags

Testingfauxfactory
Overview

FauxFactory

Build Status Python Compatibility Current Version Download Statistics Test Coverage License

FauxFactory generates random data for your automated tests easily!

There are times when you're writing tests for your application when you need to pass random, non-specific data to the areas you are testing. For these scenarios when all you need is a random string, numbers, dates, times, email address, IP, etc, then FauxFactory can help!

The full documentation is available on ReadTheDocs. It can also be generated locally:

pip install -r requirements-optional.txt
make docs-html
Comments
  • Add python-2.6 support

    Add python-2.6 support

    Support python-2.6

    • Adds a tox.ini to facilitate testing supported py_versions
    • Add a requirements-optional-26.txt file
    • Update fauxfactory/init.py to support 2.6 syntax
    • updates tests/test_*.py to conditionally import unittest2
    • Add 2.6 to .travis.yml
    opened by jlaska 22
  • Enable passing a prefix for IP addresses

    Enable passing a prefix for IP addresses

    I hope tests say all, intended to replace https://github.com/RedHatQE/cfme_tests/blob/master/utils/randomness.py#L5

    btw. what's wrong on map(str, prefix_ipv4 or []) ? Shorter than the list comprehension :smile:

    opened by mfalesni 12
  • gen_integer() change

    gen_integer() change

    Using Win64 Python2.7, sys.maxsize returns a long and the isinstance(maxsize, int) test fails. I updated this to a tuple to consider the differences with Python3 (which doesn't really use long()) by adding an integer types tuple (int, long,) depending on the platform.

    opened by apense 12
  • Add unicode letters generator

    Add unicode letters generator

    This generator is a helper for the gen_utf8 function which will provide the system supported list of unicode letters. This will avoid generating unicode string with control characters and other non letters characters.

    Also adds tests for the generator in order to ensure it is not generating unwanted characters.

    Closes #69

    opened by elyezer 11
  • Add valid netmask random generator

    Add valid netmask random generator

    I was motivated to create this because this regex used to validate netmasks https://github.com/theforeman/foreman/blob/develop/lib/net/validations.rb#L8.

    Also got some info at http://www.iplocation.net/tools/netmask.php.

    opened by elyezer 11
  • allow zero-length strings

    allow zero-length strings

    Methods like generate_alphanumeric and generate_alpha allow the user to choose how long the resultant string should be. Each of those string generation methods checks length to ensure that the value is an integer and is not too short. There are two problems here:'

    1. A length of zero is not allowed. That doesn't make sense. A user should be able to generate a zero-length string if they so desire.
    2. The validation logic in each method is identical. It should be refactored out into a single private method.
    opened by Ichimonji10 10
  • don't install tests into the binary distribution

    don't install tests into the binary distribution

    this tries to install a "tests" python package, which we don't own. at the same time, also exclude docs and contrib as done in the PyPA sample project [1]

    [1] https://github.com/pypa/sampleproject/blob/master/setup.py

    opened by evgeni 9
  • Added a method gen_vm_mac() to generate valid mac for QEMU/KVM virtual machines

    Added a method gen_vm_mac() to generate valid mac for QEMU/KVM virtual machines

    For discovery feature, I need a valid mac that I can use for VM provisioning. However the current gen_mac() doesn't generate a valid mac for VM's on QEMU/KVM. The mac address must start with sequence: 54:52:00 otherwise VM creation fails with error:

    ERROR XML error: expected unicast mac address, found multicast '63:8e:b3:53:77:b1'

    So I added a new method to generate vm mac. gen_vm_mac(). We can update existing one too if that's the best option ?

    opened by sghai 9
  • Introduce formatted string generator

    Introduce formatted string generator

    Introduce fauxfactory.generate() which takes a string with formatting similar to "".format() but instead of inserting strings, it randomizes the values based on what is located inside the braces.

    opened by mfalesni 9
  • [DONOTMERGE] Simplified ``FauxFactory`` class definition.

    [DONOTMERGE] Simplified ``FauxFactory`` class definition.

    This pull requests proposes to simplify the definition of the FauxFactory class for backwards compatibility by looking into the module's own set of functions and individually adding them to the class using setaatr, and removing a long list of function definitions that were calling the newer set of functions.

    opened by omaciel 9
  • incompatible with Python 3

    incompatible with Python 3

    Fauxfactory appears to be incompatible with Python 3.

    Why do I say this? When executing one of the example lines of code displayed in the readme (FauxFactory.generate_alphanumeric()), I get an error stating name 'unicode' is not defined. This is probably because the application assumes that it is being run under Python 2. However, unicode support has been more fully integrated in Python 3, and the "unicode" function has been removed from the standard library.

    Here's some copy-pasta from my machine:

    Python 3.4.0 (default, Mar 17 2014, 23:20:09)·                                                                        
    [GCC 4.8.2 20140206 (prerelease)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from fauxfactory import FauxFactory
    >>> FauxFactory.generate_alphanumeric()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.4/site-packages/fauxfactory/__init__.py", line 102, in generate_alphanumeric
        return unicode(output_string)
    NameError: name 'unicode' is not defined
    
    opened by Ichimonji10 8
  • generic method for all different types of unicode string gens

    generic method for all different types of unicode string gens

    We already have gen_cjk() and per pull #63 might have gen_cyrillic.

    If we wanted to, in the future, support other methods (Tamil, Telugu, etc.), we can see where this would get very cumbersome/duplicitous, very quickly.

    It might be good to have some generic function that takes any specific range and plugs it in, and then wrap that with a function specific to the unicode block you want to test.

    e.g., instead of

         codepoints = [random.randint(0x4E00, 0x9FCC) for _ in range(length)]
         try:
             # (undefined-variable) pylint:disable=E0602
             output = u''.join(unichr(codepoint) for codepoint in codepoints)
         except NameError:
             output = u''.join(chr(codepoint) for codepoint in codepoints)
         return _make_unicode(output)
    

    ...put this into a generate_unicode_range() function that can have codepoint values passed to it, and then use that inside a function for any desired unicode block...

    gen_bengali() gen_hebrew() gen_hiragana()

    Now, there is a sticky wicket in all this. Some character sets span multiple, non contiguous blocks. More details here:

    http://en.wikipedia.org/wiki/Unicode_block

    So really, we should be able to pass all desired blocks into a python list, and then either make a single range to rule them all, or simply the ability to choose a random character out of each block within the list.

    opened by cswiii 3
  • `generate_email` uses production domains

    `generate_email` uses production domains

    As described in RFC 2606, the IETF has reserved several domains for use within documentation and example code. The following top-level domains are reserved:

    • test
    • example
    • invalid
    • localhost

    Additionally, the following second-level domains are reserved:

    • example.com
    • example.net
    • example.org

    Method FauxFactory.generate_email should, by default, use these IETF-sanctioned domains.

    opened by Ichimonji10 3
Releases(v3.1.0)
Owner
Og Maciel
I'm the linchpin for a diverse team of Quality Engineers, solving problems that people haven’t predicted, seeing things people haven’t seen, connecting people.
Og Maciel
Web testing library for Robot Framework

SeleniumLibrary Contents Introduction Keyword Documentation Installation Browser drivers Usage Extending SeleniumLibrary Community Versions History In

Robot Framework 1.2k Jan 03, 2023
Tutorial for integrating Oxylabs' Residential Proxies with Selenium

Oxylabs’ Residential Proxies integration with Selenium Requirements For the integration to work, you'll need to install Selenium on your system. You c

Oxylabs.io 8 Dec 08, 2022
GitHub action for AppSweep Mobile Application Security Testing

GitHub action for AppSweep can be used to continuously integrate app scanning using AppSweep into your Android app build process

Guardsquare 14 Oct 06, 2022
Free cleverbot without headless browser

Cleverbot Scraper Simple free cleverbot library that doesn't require running a heavy ram wasting headless web browser to actually chat with the bot, a

Matheus Fillipe 3 Sep 25, 2022
A tool to auto generate the basic mocks and asserts for faster unit testing

Mock Generator A tool to generate the basic mocks and asserts for faster unit testing. 🎉 New: you can now use pytest-mock-generator, for more fluid p

31 Dec 24, 2022
A simple Python script I wrote that scrapes NASA's James Webb Space Telescope tracker website using Selenium and returns its current status and location.

A simple Python script I wrote that scrapes NASA's James Webb Space Telescope tracker website using Selenium and returns its current status and location.

9 Feb 10, 2022
Python dilinin Selenium kütüphanesini kullanarak; Amazon, LinkedIn ve ÇiçekSepeti üzerinde test işlemleri yaptığımız bir case study reposudur.

Python dilinin Selenium kütüphanesini kullanarak; Amazon, LinkedIn ve ÇiçekSepeti üzerinde test işlemleri yaptığımız bir case study reposudur. LinkedI

Furkan Gulsen 8 Nov 01, 2022
Selenium Manager

SeleniumManager I'm fed up with always having to struggle unnecessarily when I have to use Selenium on a new machine, so I made this little python mod

Victor Vague 1 Dec 24, 2021
Yet another python home automation project. Because a smart light is more than just on or off

Automate home Yet another home automation project because a smart light is more than just on or off. Overview When talking about home automation there

Maja Massarini 62 Oct 10, 2022
This repository contains a set of benchmarks of different implementations of Parquet (storage format) <-> Arrow (in-memory format).

Parquet benchmarks This repository contains a set of benchmarks of different implementations of Parquet (storage format) - Arrow (in-memory format).

11 Dec 21, 2022
Automated tests for OKAY websites in Python (Selenium) - user friendly version

Okay Selenium Testy Aplikace určená k testování produkčních webů společnosti OKAY s.r.o. Závislosti K běhu aplikace je potřeba mít v počítači nainstal

Viktor Bem 0 Oct 01, 2022
a plugin for py.test that changes the default look and feel of py.test (e.g. progressbar, show tests that fail instantly)

pytest-sugar pytest-sugar is a plugin for pytest that shows failures and errors instantly and shows a progress bar. Requirements You will need the fol

Teemu 963 Dec 28, 2022
Divide full port scan results and use it for targeted Nmap runs

Divide Et Impera And Scan (and also merge the scan results) DivideAndScan is used to efficiently automate port scanning routine by splitting it into 3

snovvcrash 226 Dec 30, 2022
PoC getting concret intel with chardet and charset-normalizer

aiohttp with charset-normalizer Context aiohttp.TCPConnector(limit=16) alpine linux nginx 1.21 python 3.9 aiohttp dev-master chardet 4.0.0 (aiohttp-ch

TAHRI Ahmed R. 2 Nov 30, 2022
Obsei is a low code AI powered automation tool.

Obsei is a low code AI powered automation tool. It can be used in various business flows like social listening, AI based alerting, brand image analysis, comparative study and more .

Obsei 782 Dec 31, 2022
Hypothesis is a powerful, flexible, and easy to use library for property-based testing.

Hypothesis Hypothesis is a family of testing libraries which let you write tests parametrized by a source of examples. A Hypothesis implementation the

Hypothesis 6.4k Jan 05, 2023
Penetration testing

Penetration testing

3 Jan 11, 2022
Let your Python tests travel through time

FreezeGun: Let your Python tests travel through time FreezeGun is a library that allows your Python tests to travel through time by mocking the dateti

Steve Pulec 3.5k Dec 29, 2022
pytest plugin for a better developer experience when working with the PyTorch test suite

pytest-pytorch What is it? pytest-pytorch is a lightweight pytest-plugin that enhances the developer experience when working with the PyTorch test sui

Quansight 39 Nov 18, 2022
Doing dirty (but extremely useful) things with equals.

Doing dirty (but extremely useful) things with equals. Documentation: dirty-equals.helpmanual.io Source Code: github.com/samuelcolvin/dirty-equals dir

Samuel Colvin 602 Jan 05, 2023