Skip to main content

Create or check file/directory trees described by YAML

Project description

See Build Status on Travis CI See Build Status on AppVeyor

Create or check file/directory trees described by YAML


This Pytest plugin was generated with Cookiecutter along with @hackebrot’s Cookiecutter-pytest-plugin template.

Features

  • Monkey-patches py.path.local class (the one behind tmpdir fixture) to append yaml_create and yaml_check methods for easy access.

  • Use it like this:

    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
        """)

Requirements

  • PyYAML

Installation

You can install “pytest-yamltree” via pip from PyPI:

$ pip install pytest-yamltree

Usage

  • TODO

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, “pytest-yamltree” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-yamltree-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_yamltree-0.1.2-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-yamltree-0.1.2.tar.gz.

File metadata

  • Download URL: pytest-yamltree-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.1

File hashes

Hashes for pytest-yamltree-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0e8d51328b3e48b37c4a37ec736514d64d87eec9dec4f9b75aeea1cd9149d0bf
MD5 7639f132e125d452b10941c6373c7081
BLAKE2b-256 75ee1ae91218b778f6e5a25bddc768b67e891424c0a8f3bfa818e96da305a1d8

See more details on using hashes here.

File details

Details for the file pytest_yamltree-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_yamltree-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.1

File hashes

Hashes for pytest_yamltree-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f87d6f79490bfc9ae900d5d0dcdd67fa706103d9731f55b8ba3af488ea960121
MD5 5933cce905c8226f05072d993b0cbc79
BLAKE2b-256 1ec928fd51079c0b35a2b013dc13cc4af12b79b7acc83864b79af5cad433958a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page