diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5534305..ebbb183 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: run unit tests using pytest +name: PyTest on: push: @@ -33,4 +33,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest + python -m pytest ./pytests + diff --git a/pytests/test_volumes.py b/pytests/test_volumes.py new file mode 100644 index 0000000..810ede3 --- /dev/null +++ b/pytests/test_volumes.py @@ -0,0 +1,19 @@ +import pytest + +from podman_compose import parse_short_mount + +@pytest.fixture +def multi_propagation_mount_str(): + return "/foo/bar:/baz:U,Z" + + +def test_parse_short_mount_multi_propagation(multi_propagation_mount_str): + expected = { + "type": "bind", + "source": "/foo/bar", + "target": "/baz", + "bind": { + "propagation": "U,Z", + }, + } + assert parse_short_mount(multi_propagation_mount_str, "/") == expected