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())
评论列表
文章目录