]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
start adding config tests
authorKevin McCarthy <me@kevinmccarthy.org>
Tue, 20 Aug 2013 05:34:22 +0000 (19:34 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Tue, 20 Aug 2013 05:49:06 +0000 (19:49 -1000)
tests/integration/test_config.py [new file with mode: 0644]

diff --git a/tests/integration/test_config.py b/tests/integration/test_config.py
new file mode 100644 (file)
index 0000000..6dcfe40
--- /dev/null
@@ -0,0 +1,14 @@
+import json
+import urllib2
+import vcr
+
+def test_set_serializer_default_config(tmpdir):
+    my_vcr = vcr.VCR(serializer='json')
+
+    with my_vcr.use_cassette(str(tmpdir.join('test.json'))) as cass:
+        assert my_vcr.serializer == 'json'
+        urllib2.urlopen('http://httpbin.org/get')
+
+    with open(str(tmpdir.join('test.json'))) as f:
+        assert json.loads(f.read())
+