Skip to content

Commit

Permalink
partially update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
oraNod committed Jul 24, 2024
1 parent 3b210e2 commit 695e8ac
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/integration/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,31 @@
import re
import shlex
import subprocess

from pathlib import Path

import pytest


@pytest.fixture()
def collection_path(tmp_path: Path) -> Path:
"""Create a temporary directory for the collection."""
"""Create a temporary directory for the collection.
Args:
tmp_path: Temporary path.
"""
test_path = ("collections", "ansible_collections")
final_dest = tmp_path.joinpath(*test_path)
final_dest.mkdir(parents=True, exist_ok=True)
return final_dest


def test_create_collection(collection_path: Path) -> None:
"""Scaffold a collection with ansible-creator."""
"""Scaffold a collection with ansible-creator.
Args:
collection_path: Path for scaffolded collection.
"""
# Check that the collection path is present.
assert collection_path.exists

Expand All @@ -40,6 +49,7 @@ def test_create_collection(collection_path: Path) -> None:
text=True,
shell=True,
capture_output=True,
check=False,
)
assert result.returncode == 0

Expand All @@ -55,7 +65,11 @@ def test_lint_collection(collection_path: Path) -> None:

# Validate the collection with ansible-lint.
result = subprocess.run(
["ansible-lint", collection_dir], shell=True, text=True, capture_output=True
["ansible-lint", collection_dir],
shell=True,
text=True,
capture_output=True,
check=False,
)

if result.returncode != 0:
Expand Down

0 comments on commit 695e8ac

Please sign in to comment.