Skip to content

Commit

Permalink
feat(docs): add example
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Dec 24, 2016
1 parent c8e7a39 commit d79a6da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ Time TTL limited mock



Regular expression matching
^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../examples/regex.py



``unittest`` integration
^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions examples/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import requests


# Registry mock definition
(pook.get('httpbin.org')
# Mock definition based
(pook.get(pook.regex('h[t]{2}pbin.*'))
.path(pook.regex('/foo/[a-z]+/baz'))
.header('Client', pook.regex('requests|pook'))
.times(2)
Expand Down

0 comments on commit d79a6da

Please sign in to comment.