文件系统断言插件`
thefs的Python项目详细描述
python文件系统更好的断言
用于the断言文件系统内容的断言库。
API
- basename(dir)。断言路径的basename。
- dirname(dir)。断言路径的dirname。
- extname(file)。断言文件扩展名
- path。断言路径存在
- file。将其断言为文件
- dir。断言为dir
- mount。将其断言为装入点
- absolute_path。断言它是绝对路径
- readable。断言可读。
- writable。断言可写。
- executableassert可执行文件
用法:
fromtheimporttheimportthefsthe.use(thefs)the("/a/b/c.md").should.have.basename("c.md")the("/a/b/c.md").should.have.dirname("/a/b")the("/a/b/c.md").should.have.extname("/a/b")the("/a/b/c.md").should.be.a.paththe("/a/b/c.md").should.be.a.filethe("/a/b/c.md").should.be.a.dirthe("/a/b/c.md").should.be.a.linkthe("/a/b/c.md").should.be.a.mountthe("/a/b/c.md").should.be.an.absolute_paththe("/a/b/c.md").should.be.readablethe("/a/b/c.md").should.be.writablethe("/a/b/c.md").should.be.executable