test_inner_stash.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:sstash 作者: realcr 项目源码 文件源码
def test_value_write_failure_invalid_type():
    """
    Try writing a value not of type bytes. Should raise an exception.
    """
    ins = InnerStash({})

    with pytest.raises(SSValueError):
        ins.write_value(['hello','world'],3)

    with pytest.raises(SSValueError):
        ins.write_value(['hello','world'],"A string!")

    # Try writing a dummy class instance:
    class MyClass:
        pass

    with pytest.raises(SSValueError):
        ins.write_value(['hello','world'],MyClass())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号