mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
use_cassette -> CassetteContextDecorator
This commit is contained in:
16
tests/unit/test_vcr.py
Normal file
16
tests/unit/test_vcr.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import mock
|
||||
|
||||
from vcr import VCR
|
||||
|
||||
|
||||
|
||||
def test_vcr_use_cassette():
|
||||
filter_headers = mock.Mock()
|
||||
test_vcr = VCR(filter_headers=filter_headers)
|
||||
with mock.patch('vcr.config.Cassette') as mock_cassette_class:
|
||||
@test_vcr.use_cassette('test')
|
||||
def function():
|
||||
pass
|
||||
mock_cassette_class.call_count == 0
|
||||
function()
|
||||
assert mock_cassette_class.use.call_args[1]['filter_headers'] is filter_headers
|
||||
Reference in New Issue
Block a user