]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Added test: accessing same recource three times in once mode
authorVeros Kaplan <kaplan.v@czechglobe.cz>
Wed, 6 Nov 2013 12:33:31 +0000 (13:33 +0100)
committerKevin McCarthy <me@kevinmccarthy.org>
Sun, 10 Nov 2013 20:54:09 +0000 (10:54 -1000)
tests/integration/test_record_mode.py

index e3fdc8d5af02df066bd2ea5db08c937ad73fe5ba..f38c9bb9d8367847efe6d0b049628e447ede424a 100644 (file)
@@ -32,6 +32,14 @@ def test_once_record_mode_two_times(tmpdir):
         response = urllib2.urlopen('http://httpbin.org/').read()
         response = urllib2.urlopen('http://httpbin.org/').read()
 
+def test_once_mode_three_times(tmpdir):
+    testfile = str(tmpdir.join('recordmode.yml'))
+    with vcr.use_cassette(testfile, record_mode="once"):
+       # get three same files
+        response1 = urllib2.urlopen('http://httpbin.org/').read()
+        response2 = urllib2.urlopen('http://httpbin.org/').read()
+        response2 = urllib2.urlopen('http://httpbin.org/').read()
+
 def test_new_episodes_record_mode(tmpdir):
     testfile = str(tmpdir.join('recordmode.yml'))