Metadata-Version: 2.0
Name: hypothesis-regex
Version: 0.2
Summary: Hypothesis extension to allow generating strings based on regex
Home-page: https://github.com/maximkulkin/hypothesis-regex
Author: Maxim Kulkin
Author-email: maxim.kulkin@gmail.com
License: MIT
Keywords: hypothesis,regex
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: hypothesis (>=3.8)
Requires-Dist: six (>=1.10)

****************
hypothesis-regex
****************

.. image:: https://img.shields.io/pypi/l/hypothesis-regex.svg
    :target: https://github.com/maximkulkin/hypothesis-regex/blob/master/LICENSE
    :alt: License: MIT

.. image:: https://img.shields.io/travis/maximkulkin/hypothesis-regex.svg
    :target: https://travis-ci.org/maximkulkin/hypothesis-regex
    :alt: Build Status

.. image:: https://img.shields.io/pypi/v/hypothesis-regex.svg
    :target: https://pypi.python.org/pypi/hypothesis-regex
    :alt: PyPI

`Hypothesis <https://hypothesis.readthedocs.io/en/latest/>`_ extension 
to allow generating strings based on regex. Useful in case you have some schema
(e.g. JSON Schema) which already has regular expressions validating data.

Example
=======

.. code:: python

    from hypothesis_regex import regex
    import requests
    import json

    EMAIL_REGEX = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]{2,}\.[a-zA-Z0-9-.]{2,}$"

    @given(regex(EMAIL_REGEX))
    def test_registering_user(email):
        response = requests.post('/signup', json.dumps({'email': email}))
        assert response.status_code == 201


Installation
============
::

    $ pip install hypothesis-regex

Requirements
============

- Python >= 2.7 and <= 3.6
- `hypothesis <https://pypi.python.org/pypi/hypothesis>`_ >= 3.8

Project Links
=============

- PyPI: https://pypi.python.org/pypi/hypothesis-regex
- Issues: https://github.com/maximkulkin/hypothesis-regex/issues

License
=======

MIT licensed. See the bundled `LICENSE <https://github.com/maximkulkin/hypothesis-regex/blob/master/LICENSE>`_ file for more details.


