]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
add a couple more tests, change played api to require request being played
authorKevin McCarthy <me@kevinmccarthy.org>
Thu, 8 Aug 2013 07:34:15 +0000 (21:34 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 01:05:41 +0000 (15:05 -1000)
tests/unit/test_cassettes.py
vcr/cassette.py

index 42d1dfd0b7c0c16738bebfc7f7b0f0b08700cb1b..e90131b1e509366c2dcd9966fe5c7dc9fc97b6f5 100644 (file)
@@ -26,8 +26,17 @@ def test_cassette_not_played():
 
 def test_cassette_played():
     a = Cassette('test')
-    a.mark_played()
-    assert a.play_count == 1
+    a.mark_played('foo')
+    a.mark_played('foo')
+    assert a.play_count == 2
+
+def test_cassette_play_counter():
+    a = Cassette('test')
+    a.mark_played('foo')
+    a.mark_played('bar')
+    assert a.play_counts['foo'] == 1
+    assert a.play_counts['bar'] == 1
+
 
 def test_cassette_append():
     a = Cassette('test')
index 7de9148468c6b5083399b78b7bed585d1ce31ba8..3c22c5b7a58db8b76ac09ab27bb0616519d6db7f 100644 (file)
@@ -48,7 +48,7 @@ class Cassette(object):
     def play_count(self):
         return sum(self.play_counts.values())
 
-    def mark_played(self, request=None):
+    def mark_played(self, request):
         '''
         Alert the cassette of a request that's been played
         '''