当前位置: 首页>>代码示例>>Python>>正文


Python Cassette.append方法代码示例

本文整理汇总了Python中vcr.cassette.Cassette.append方法的典型用法代码示例。如果您正苦于以下问题:Python Cassette.append方法的具体用法?Python Cassette.append怎么用?Python Cassette.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vcr.cassette.Cassette的用法示例。


在下文中一共展示了Cassette.append方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_before_record_response

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_before_record_response():
    before_record_response = mock.Mock(return_value="mutated")
    cassette = Cassette("test", before_record_response=before_record_response)
    cassette.append("req", "res")

    before_record_response.assert_called_once_with("res")
    assert cassette.responses[0] == "mutated"
开发者ID:teury,项目名称:vcrpy,代码行数:9,代码来源:test_cassettes.py

示例2: test_cassette_cant_read_same_request_twice

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_cant_read_same_request_twice():
    a = Cassette('test')
    a.append('foo', 'bar')
    a.play_response('foo')
    with pytest.raises(UnhandledHTTPRequestError):
        a.play_response('foo')
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:8,代码来源:test_cassettes.py

示例3: test_cassette_responses_of

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_responses_of():
    a = Cassette('test')
    a.append('foo', 'bar')
    assert a.responses_of('foo') == ['bar']
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:6,代码来源:test_cassettes.py

示例4: test_cassette_contains

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_contains():
    a = Cassette('test')
    a.append('foo', 'bar')
    assert 'foo' in a
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:6,代码来源:test_cassettes.py

示例5: test_cassette_len

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_len():
    a = Cassette('test')
    a.append('foo', 'bar')
    a.append('foo2', 'bar2')
    assert len(a) == 2
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:7,代码来源:test_cassettes.py

示例6: test_cassette_append

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_append():
    a = Cassette('test')
    a.append('foo', 'bar')
    assert a.requests == ['foo']
    assert a.responses == ['bar']
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:7,代码来源:test_cassettes.py

示例7: test_cassette_all_played

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_all_played():
    a = Cassette('test')
    a.append('foo', 'bar')
    a.play_response('foo')
    assert a.all_played
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:7,代码来源:test_cassettes.py

示例8: test_cassette_not_all_played

# 需要导入模块: from vcr.cassette import Cassette [as 别名]
# 或者: from vcr.cassette.Cassette import append [as 别名]
def test_cassette_not_all_played():
    a = Cassette('test')
    a.append('foo', 'bar')
    assert not a.all_played
开发者ID:IvanMalison,项目名称:vcrpy,代码行数:6,代码来源:test_cassettes.py


注:本文中的vcr.cassette.Cassette.append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。