1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 09:13:23 +00:00

add a couple more tests, change played api to require request being played

This commit is contained in:
Kevin McCarthy
2013-08-07 21:34:15 -10:00
parent 4cdf5f7483
commit e39b48e73b
2 changed files with 12 additions and 3 deletions

View 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')

View 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
'''