创建或检查yaml描述的文件/目录树

pytest-yamltree的Python项目详细描述


See Build Status on Travis CISee Build Status on AppVeyor

创建或检查yaml描述的文件/目录树


这个Pytest插件是用Cookiecutter@hackebrotCookiecutter-pytest-plugin模板生成的。

功能

  • monkey补丁py.path.local类(位于tmpdirfixture后面的一个)附加yaml_createyaml_check方法以便于访问。

  • 像这样使用:

    def test_foo(tmpdir):
        tmpdir.yaml_create("""
            directory_one:
                file1: Hello World
                file2: "Including\nLine\nBreaks\n"
                subdir:
                    file3: |
                        Some raw content here.
                        It is probably better readable.
            directory_two:
                arrow.gif: !!binary |
                    R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
                    OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
                    +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
                    AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
        """)
    
        # now these files are created under tmpdir
        assert tmpdir.join('directory_one', 'file1').read() == 'Hello World'
    
        # also can check that directory structure corresponds to the declaration
        tmpdir.yaml_check("""
            directory_one:
                file1: Content
            directory_two: {}  # empty mapping means empty directory
        """)
    

要求

  • 皮亚姆

安装

您可以通过pipPyPI

$ pip install pytest-yamltree

用法

  • 待办事项

贡献

我们非常欢迎您的贡献。测试可以用tox运行,请确保 在提交请求之前,覆盖范围至少保持不变。

许可证

“pytest yamltree”是根据MIT许可证的条款发布的免费开源软件

问题

如果您遇到任何问题,请file an issue连同详细说明。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在Grails中集成javaapplet   动态设置片段时发生java错误   JavaSpringVelocity模板电子邮件?   SpringHateOAS中java自定义json输出   java wait()和notify()相关问题   正则表达式中的单词边界是什么?   使用外部库将项目部署到glassfish后发生java NoClassDefFoundError   java为什么在这里初始化ListNode两次?   java libGDX移动三维模型   java使线程等待另一个线程的执行   正则表达式如何在java中使用正则表达式解析给定字符串   java SWT ScrolledComposite在32768像素后切断画布生成的图像