File: test_utils.py

package info (click to toggle)
ansible-runner 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: python: 9,896; makefile: 19
file content (12 lines) | stat: -rw-r--r-- 394 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import os
import stat

from ansible_runner.utils import dump_artifact


def test_artifact_permissions(tmp_path):
    """Artifacts should allow user read/write"""
    filename = dump_artifact("artifact content", str(tmp_path))
    file_mode = stat.S_IMODE(os.stat(filename).st_mode)
    user_rw = stat.S_IRUSR | stat.S_IWUSR
    assert (user_rw & file_mode) == user_rw, "file mode is incorrect"