File: test_all_plugins.py

package info (click to toggle)
python-npe2 0.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 828 kB
  • sloc: python: 7,088; makefile: 19
file content (25 lines) | stat: -rw-r--r-- 643 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
from typing import TYPE_CHECKING

import pytest

from npe2.cli import app

if TYPE_CHECKING:
    from pathlib import Path

PLUGIN: str = os.getenv("TEST_PACKAGE_NAME") or ""
if not PLUGIN:
    pytest.skip("skipping plugin specific tests", allow_module_level=True)


def test_fetch(tmp_path: "Path"):
    from typer.testing import CliRunner

    mf_file = tmp_path / "manifest.yaml"

    result = CliRunner().invoke(app, ["fetch", PLUGIN, "-o", str(mf_file)])
    assert result.exit_code == 0
    assert PLUGIN in mf_file.read_text()
    result2 = CliRunner().invoke(app, ["validate", str(mf_file)])
    assert result2.exit_code == 0