mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Let's have the new exceptions subclass basic exception types
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
import yaml
|
||||
import mock
|
||||
from vcr.cassette import Cassette, UnhandledHTTPRequestError
|
||||
from vcr.cassette import Cassette
|
||||
from vcr.errors import UnhandledHTTPRequestError
|
||||
|
||||
|
||||
def test_cassette_load(tmpdir):
|
||||
|
||||
@@ -13,10 +13,7 @@ from .patch import install, reset
|
||||
from .persist import load_cassette, save_cassette
|
||||
from .serializers import yamlserializer
|
||||
from .matchers import requests_match, url, method
|
||||
|
||||
|
||||
class UnhandledHTTPRequestError(Exception):
|
||||
pass
|
||||
from .errors import UnhandledHTTPRequestError
|
||||
|
||||
|
||||
class Cassette(ContextDecorator):
|
||||
|
||||
10
vcr/errors.py
Normal file
10
vcr/errors.py
Normal file
@@ -0,0 +1,10 @@
|
||||
class CannotOverwriteExistingCassetteException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class UnhandledHTTPRequestError(KeyError):
|
||||
'''
|
||||
Raised when a cassette does not c
|
||||
ontain the request we want
|
||||
'''
|
||||
pass
|
||||
@@ -4,10 +4,7 @@ from httplib import HTTPConnection, HTTPSConnection, HTTPMessage
|
||||
from cStringIO import StringIO
|
||||
|
||||
from vcr.request import Request
|
||||
|
||||
|
||||
class CannotOverwriteExistingCassetteException(Exception):
|
||||
pass
|
||||
from vcr.errors import CannotOverwriteExistingCassetteException
|
||||
|
||||
|
||||
def parse_headers(header_list):
|
||||
|
||||
Reference in New Issue
Block a user