test_api.py 文件源码

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

项目:senf 作者: quodlibet 项目源码 文件源码
def test_path2fsn_pathlike():
    # basic tests for os.fspath
    with pytest.raises(TypeError):
        os.fspath(PathLike(None))
    assert os.fspath(PathLike(fsnative(u"foo"))) == fsnative(u"foo")
    assert os.fspath(PathLike(u"\u1234")) == u"\u1234"

    # now support in path2fsn
    pathlike = PathLike(fsnative(u"foo"))
    assert path2fsn(pathlike) == fsnative(u"foo")

    # pathlib should also work..
    from pathlib import Path
    assert path2fsn(Path(".")) == fsnative(u".")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号