mirror of
https://github.com/containers/podman-compose.git
synced 2024-12-23 23:28:54 +01:00
add unit tests
This commit is contained in:
parent
064521255b
commit
4f025679cf
5
.github/workflows/pytest.yml
vendored
5
.github/workflows/pytest.yml
vendored
@ -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
|
||||
|
||||
|
19
pytests/test_volumes.py
Normal file
19
pytests/test_volumes.py
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user