summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-04-18 13:13:42 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-04-18 13:40:23 -0500
commit1114085dbb38be59ecb862f77e752772d7b55ca1 (patch)
treecc0e4dea359f5a73660a6880172711269f8fbd14 /docs
parentb59397f5583303f1a9f74781c7db098cfffadbac (diff)
downloadrequests-cache-1114085dbb38be59ecb862f77e752772d7b55ca1.tar.gz
Turn VCR converter into an example in the docs instead of a library feature
Diffstat (limited to 'docs')
-rw-r--r--docs/examples.md14
-rw-r--r--docs/user_guide/compatibility.md11
2 files changed, 25 insertions, 0 deletions
diff --git a/docs/examples.md b/docs/examples.md
index 376e458..779a64d 100644
--- a/docs/examples.md
+++ b/docs/examples.md
@@ -166,3 +166,17 @@ The following scripts can also be found in the
:lines: 6-
```
:::
+
+
+### VCR Export
+```{include} ../examples/vcr.py
+:start-line: 2
+:end-line: 5
+```
+
+:::{admonition} Example: `vcr.py`
+:class: toggle
+```{literalinclude} ../examples/vcr.py
+:lines: 7-
+```
+::: \ No newline at end of file
diff --git a/docs/user_guide/compatibility.md b/docs/user_guide/compatibility.md
index 47eb5d4..fff338c 100644
--- a/docs/user_guide/compatibility.md
+++ b/docs/user_guide/compatibility.md
@@ -172,3 +172,14 @@ requests-mock examples above.
```{literalinclude} ../../tests/compat/test_responses_load_cache.py
```
:::
+
+## VCR
+If you would like to reuse your cached response data for unit tests, one option is to convert your
+cache into a format compatible with VCR-vased libraries like
+[vcrpy](https://github.com/kevin1024/vcrpy) and [betamax](https://github.com/betamaxpy/betamax).
+:::{admonition} Example: vcr.py
+:class: toggle
+```{literalinclude} ../../examples/vcr.py
+:lines: 7-
+```
+:::