mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-10 01:25:34 +00:00
Fix issue #36 - error message for unregistered matcher was broken
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import json
|
||||
import urllib2
|
||||
import pytest
|
||||
import vcr
|
||||
|
||||
|
||||
@@ -45,3 +46,11 @@ def test_override_match_on(tmpdir):
|
||||
|
||||
assert len(cass) == 1
|
||||
assert cass.play_count == 1
|
||||
|
||||
|
||||
def test_missing_matcher():
|
||||
my_vcr = vcr.VCR()
|
||||
my_vcr.register_matcher("awesome", object)
|
||||
with pytest.raises(KeyError):
|
||||
with my_vcr.use_cassette("test.yaml", match_on=['notawesome']):
|
||||
pass
|
||||
|
||||
@@ -46,6 +46,7 @@ def test_flickr_multipart_upload():
|
||||
_pretend_to_be_flickr_library()
|
||||
assert cass.play_count == 1
|
||||
|
||||
|
||||
def test_flickr_should_respond_with_200(tmpdir):
|
||||
testfile = str(tmpdir.join('flickr.yml'))
|
||||
with vcr.use_cassette(testfile):
|
||||
|
||||
@@ -50,6 +50,7 @@ def test_cassette_len():
|
||||
def _mock_requests_match(request1, request2, matchers):
|
||||
return request1 == request2
|
||||
|
||||
|
||||
@mock.patch('vcr.cassette.requests_match', _mock_requests_match)
|
||||
def test_cassette_contains():
|
||||
a = Cassette('test')
|
||||
|
||||
Reference in New Issue
Block a user