test_traits.py 文件源码

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

项目:crowddynamics 作者: jaantollander 项目源码 文件源码
def test_shape_validator():
    trait = None
    value = Mock()

    correct = (1, 1)
    validator = shape_validator(*correct)
    value.shape = correct
    assert validator(trait, value).shape == value.shape

    incorrect = (1, 2)
    value.shape = incorrect
    pytest.raises(traitlets.TraitError, validator, trait, value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号