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 PENETRATION TESTING TOOL 💥

N-WEB ADVANCE WEB PENETRATION TESTING TOOL Features 🎭 Admin Panel Finder Admin Scanner Dork Generator Advance Dork Finder Extract Links No Redirect H

56 Dec 23, 2022
A framework-agnostic library for testing ASGI web applications

async-asgi-testclient Async ASGI TestClient is a library for testing web applications that implements ASGI specification (version 2 and 3). The motiva

122 Nov 22, 2022
Aioresponses is a helper for mock/fake web requests in python aiohttp package.

aioresponses Aioresponses is a helper to mock/fake web requests in python aiohttp package. For requests module there are a lot of packages that help u

402 Jan 06, 2023
Subprocesses for Humans 2.0.

Delegator.py — Subprocesses for Humans 2.0 Delegator.py is a simple library for dealing with subprocesses, inspired by both envoy and pexpect (in fact

Amit Tripathi 1.6k Jan 04, 2023
Asyncio http mocking. Similar to the responses library used for 'requests'

aresponses an asyncio testing server for mocking external services Features Fast mocks using actual network connections allows mocking some types of n

93 Nov 16, 2022
A pytest plugin, that enables you to test your code that relies on a running PostgreSQL Database

This is a pytest plugin, that enables you to test your code that relies on a running PostgreSQL Database. It allows you to specify fixtures for PostgreSQL process and client.

Clearcode 252 Dec 21, 2022
Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes in a variety of languages.

Mimesis - Fake Data Generator Description Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes

Isaak Uchakaev 3.8k Dec 29, 2022
Implement unittest, removing all global variable and returning values

Implement unittest, removing all global variable and returning values

Placide 1 Nov 01, 2021
Just for testing video streaming using pytgcalls.

tgvc-video-tests Just for testing video streaming using pytgcalls. Note: The features used in this repository is highly experimental and you might not

wrench 34 Dec 27, 2022
Webscreener is a tool for mass web domains pentesting.

Webscreener is a tool for mass web domains pentesting. It is used to take snapshots for domains that is generated by a tool like knockpy or Sublist3r. It cuts out most of the pentesting time by scree

Seekurity 3 Jun 07, 2021
Python selenium script to bypass simaster.ugm.ac.id weak captcha.

Python selenium script to bypass simaster.ugm.ac.id weak "captcha".

Hafidh R K 1 Feb 01, 2022
Declarative HTTP Testing for Python and anything else

Gabbi Release Notes Gabbi is a tool for running HTTP tests where requests and responses are represented in a declarative YAML-based form. The simplest

Chris Dent 139 Sep 21, 2022
The evaluator covering all of the metrics required by tasks within the DUE Benchmark.

DUE Evaluator The repository contains the evaluator covering all of the metrics required by tasks within the DUE Benchmark, i.e., set-based F1 (for KI

DUE Benchmark 4 Jan 21, 2022
Selenium-python but lighter: Helium is the best Python library for web automation.

Selenium-python but lighter: Helium Selenium-python is great for web automation. Helium makes it easier to use. For example: Under the hood, Helium fo

Michael Herrmann 3.2k Dec 31, 2022
catsim - Computerized Adaptive Testing Simulator

catsim - Computerized Adaptive Testing Simulator Quick start catsim is a computerized adaptive testing simulator written in Python 3.4 (with modificat

Nguyễn Văn Anh Tuấn 1 Nov 29, 2021
This is a Python script for Github Bot which uses Selenium to Automate things.

github-follow-unfollow-bot This is a Python script for Github Bot which uses Selenium to Automate things. Pre-requisites :- Python A Github Account Re

Chaudhary Hamdan 10 Jul 01, 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
This repository contains a testing script for nmigen-boards that tries to build blinky for all the platforms provided by nmigen-boards.

Introduction This repository contains a testing script for nmigen-boards that tries to build blinky for all the platforms provided by nmigen-boards.

S.J.R. van Schaik 4 Jul 23, 2022
A automated browsing experience.

browser-automation This app is an automated browsing technique where one has to enter the required information, it's just like searching for Animals o

Ojas Barawal 3 Aug 04, 2021
A Python program that will log into your scheduled Google Meets hands free

Chrome GMautomation General Information This Python program will open up Chrome and log into your scheduled Google Meet with camera and mic turned off

Jonathan Leow 5 Dec 31, 2021