-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
214 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|PyPI version| |RTD badget|\ |Build Status| | ||
|
||
.. figure:: https://github.com/SpectoLabs/hoverpy/raw/master/docs/source/hoverpy_logo.png | ||
:alt: | ||
|
||
Documentation | ||
~~~~~~~~~~~~~ | ||
|
||
https://hoverpy.readthedocs.io/ | ||
|
||
Source | ||
~~~~~~ | ||
|
||
https://github.com/SpectoLabs/hoverpy/ | ||
|
||
Motivation | ||
~~~~~~~~~~ | ||
|
||
HoverPy speeds up and simplifies tests that depend on HTTP / HTTPS | ||
services. It does so by recording all HTTP traffic generated by your | ||
python application inside a database file. | ||
|
||
When you run your code again, it plays back the responses corresponding | ||
to your requests. This means during the simulate phase, no HTTP traffic | ||
gets generated whatsoever. This grants several benefits: | ||
|
||
- Increased test speed | ||
- Ability to work offline | ||
- Ability to modify traffic | ||
- Ability to simulate network latency | ||
- Deterministic test environment | ||
|
||
If/when the service you are testing against changes its API, then you | ||
can simply delete your db file, and capture the test results again. | ||
HoverPy uses a `very high performance proxy written in | ||
Go <http://hoverfly.io>`__, for this reason it is rock solid in terms of | ||
speed and reliability. | ||
|
||
Support | ||
~~~~~~~ | ||
|
||
HoverPy works great with the following HTTP clients: | ||
|
||
- requests | ||
- TBD | ||
|
||
License | ||
~~~~~~~ | ||
|
||
HoverPy uses Apache License V2. See LICENSE.txt for more details. | ||
|
||
.. |PyPI version| image:: https://badge.fury.io/py/hoverpy.svg | ||
:target: https://testpypi.python.org/pypi/hoverpy | ||
.. |RTD badget| image:: https://readthedocs.org/projects/pip/badge/?version=latest | ||
:target: http://hoverpy.readthedocs.io/en/latest/ | ||
.. |Build Status| image:: https://travis-ci.org/SpectoLabs/hoverpy.svg?branch=master | ||
:target: https://travis-ci.org/SpectoLabs/hoverpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.. basic | ||
Basic Example | ||
Basic | ||
******** | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.. delays | ||
delays Example | ||
delays | ||
******** | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Examples | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
basic.rst | ||
readthedocs.rst | ||
modify.rst | ||
delays.rst | ||
unittesting.rst | ||
|
||
basic | ||
----- | ||
|
||
.. code:: bash | ||
python examples/basic/basic.py | ||
This is the most basic example possible. Captures one request, and | ||
replays it. | ||
|
||
`readthedocs <readthedocs.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
python examples/readthedocs/readthedocs.py | ||
Slightly more advanced example, where we query readthedocs.io for | ||
articles, get these articles. The program can be run in capture or | ||
simulate mode, and the functionality is timed. | ||
|
||
`delays <delays.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
python examples/delays/delays.py | ||
Demonstrates how to add latency to calls, based on host, and method | ||
type. | ||
|
||
`modify <modify.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
python examples/modify/modify.py | ||
Demonstrations how to modify requests. This is particularly useful for | ||
sending curved balls to your applications, and make sure they deal with | ||
them correctly. | ||
|
||
`unittesting <unittesting.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
env HOVERPY_CAPTURE=true python examples/unittesting/unittesting.py | ||
python examples/unittesting/unittesting.py | ||
Demonstrates how to use the ``hoverpy.TestCase`` class for unit testing | ||
purposes. | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,21 @@ | ||
HoverPy | ||
======= | ||
HoverPy |version| Documentation | ||
********************* | ||
|
||
|PyPI version| |RTD badget|\ |Build Status| | ||
.. include:: README.rst | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` | ||
|
||
|
||
Hoverpy is a Python library that enables you to transparently use | ||
`HoverFly <https://github.com/SpectoLabs/hoverfly>`__ in your python | ||
applications. | ||
|
||
Hoverfly is a lightweight, open source service virtualization tool. | ||
Using Hoverfly, you can virtualize your application dependencies to | ||
create a self-contained development or test environment. | ||
|
||
Installation | ||
------------ | ||
|
||
If you plan on trying out the examples: | ||
|
||
.. code:: bash | ||
git clone https://github.com/SpectoLabs/hoverpy.git | ||
cd hoverpy | ||
python setup.py test | ||
# please note, this is not required for running the examples, only for installing your local copy: | ||
# sudo python setup.py install | ||
Or whether you just want to install it using pip (not yet recommended): | ||
|
||
.. code:: bash | ||
pip install --user -i https://testpypi.python.org/pypi hoverpy | ||
Test | ||
---- | ||
|
||
.. code:: bash | ||
make test | ||
# or | ||
python setup.py test | ||
Examples | ||
-------- | ||
Contents | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
basic.rst | ||
readthedocs.rst | ||
modify.rst | ||
delays.rst | ||
unittesting.rst | ||
|
||
`basic <basic.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
:maxdepth: 2 | ||
|
||
python examples/basic/basic.py | ||
installation.rst | ||
usage.rst | ||
|
||
This is the most basic example possible. Captures one request, and | ||
replays it. | ||
================== | ||
Indices and tables | ||
================== | ||
|
||
`readthedocs <readthedocs.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
python examples/readthedocs/readthedocs.py | ||
Slightly more advanced example, where we query readthedocs.io for | ||
articles, get these articles. The program can be run in capture or | ||
simulate mode, and the functionality is timed. | ||
|
||
`delays <delays.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
python examples/delays/delays.py | ||
Demonstrates how to add latency to calls, based on host, and method | ||
type. | ||
|
||
`modify <modify.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
python examples/modify/modify.py | ||
Demonstrations how to modify requests. This is particularly useful for | ||
sending curved balls to your applications, and make sure they deal with | ||
them correctly. | ||
|
||
`unittesting <unittesting.html>`__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: bash | ||
env HOVERPY_CAPTURE=true python examples/unittesting/unittesting.py | ||
python examples/unittesting/unittesting.py | ||
Demonstrates how to use the ``hoverpy.TestCase`` class for unit testing | ||
purposes. | ||
|
||
-------------- | ||
|
||
|logo| | ||
====== | ||
|
||
.. |PyPI version| image:: https://badge.fury.io/py/hoverpy.svg | ||
:target: https://testpypi.python.org/pypi/hoverpy | ||
.. |RTD badget| image:: https://readthedocs.org/projects/pip/badge/?version=latest | ||
:target: http://hoverpy.readthedocs.io/en/latest/ | ||
.. |Build Status| image:: https://travis-ci.org/SpectoLabs/hoverpy.svg?branch=master | ||
:target: https://travis-ci.org/SpectoLabs/hoverpy | ||
.. |logo| image:: https://github.com/SpectoLabs/hoverfly/raw/master/core/static/img/hoverfly_logo.png | ||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. installation | ||
Installation | ||
------------ | ||
|
||
If you plan on trying out the examples: | ||
|
||
.. code:: bash | ||
git clone https://github.com/SpectoLabs/hoverpy.git | ||
cd hoverpy | ||
python setup.py test | ||
# please note, this is not required for running the examples, only for installing your local copy: | ||
# sudo python setup.py install | ||
Or whether you just want to install it using pip (not yet recommended): | ||
|
||
.. code:: bash | ||
pip install --user -i https://testpypi.python.org/pypi hoverpy | ||
Test | ||
---- | ||
|
||
.. code:: bash | ||
make test | ||
# or | ||
python setup.py test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.. modify | ||
modify Example | ||
modify | ||
******** | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.. unittesting | ||
unittesting Example | ||
unittesting | ||
******** | ||
|
||
|
||
|
Oops, something went wrong.