import yaml
from vcr.cassette import Cassette

def test_cassette_load(tmpdir):
    a_file = tmpdir.join('test_cassette.yml')
    a_file.write(yaml.dumps([
        {'request':'foo', 'response':'bar'}
    ]))
    a_cassette = Cassette.load(a_file)
    assert a_cassette._requests
    assert a_cassette._responses


@@ -1,12 +1,24 @@
+import mock%0A
 import yaml%0A
@@ -17,16 +17,16 @@
 rt yaml%0A
-
 from vcr
@@ -156,17 +156,16 @@
 aml.dump
-s
 (%5B%0A     
@@ -246,15 +246,20 @@
 oad(
+str(
 a_file)
+)
 %0A   
@@ -321,8 +321,1147 @@
 ponses%0A%0A
+def test_cassette_serialize():%0A    a = Cassette('test')%0A    a._requests = %5B'foo'%5D%0A    a._responses = %5B'bar'%5D%0A    assert a.serialize() == %5B%7B'request': 'foo', 'response': 'bar'%7D%5D%0A%0Adef test_cassette_deserialize():%0A    a = Cassette('test')%0A    a.deserialize(%5B%7B'request': 'foo', 'response': 'bar'%7D%5D)%0A    assert a._requests == %5B'foo'%5D%0A    assert a._responses == %5B'bar'%5D%0A%0Adef test_cassette_not_cached():%0A    a = Cassette('test')%0A    assert not a.cached()%0A%0Adef test_cassette_cached():%0A    a = Cassette('test')%0A    a.cached('yup')%0A    assert a.cached()%0A%0Adef test_cassette_append():%0A    a = Cassette('test')%0A    a.append('foo', 'bar')%0A    assert a._requests == %5B'foo'%5D%0A    assert a._responses == %5B'bar'%5D%0A%0Adef test_cassette_len():%0A    a = Cassette('test')%0A    a.append('foo','bar')%0A    a.append('foo2','bar2')%0A    assert len(a) == 2%0A%0Adef test_cassette_contains():%0A    a = Cassette('test')%0A    a.append('foo','bar')%0A    assert 'foo' in a%0A%0Adef test_cassette_response():%0A    a = Cassette('test')%0A    a.append('foo','bar')%0A    assert a.response('foo') == 'bar'%0A%0Adef test_cassette_missing_response():%0A    a = Cassette('test')%0A    assert a.response('foo')%0A

add unit tests for Cassette implementation