File: test_sys_exit.py

package info (click to toggle)
stac-validator 3.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,120 kB
  • sloc: python: 3,347; makefile: 100
file content (32 lines) | stat: -rw-r--r-- 809 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
import subprocess

import pytest


def test_correct_sys_exit_error_python():
    with pytest.raises(subprocess.CalledProcessError):
        subprocess.run(
            ["stac-validator", "tests/test_data/bad_data/bad_item_v090.json"],
            check=True,
        )


def test_correct_sys_exit_error_recursion():
    with pytest.raises(subprocess.CalledProcessError):
        subprocess.run(
            [
                "stac-validator",
                "tests/test_data/v100/catalog-with-bad-item.json",
                "--recursive",
                "--max-depth",
                "10",
            ],
            check=True,
        )


def test_false_sys_exit_error_python():
    subprocess.run(
        ["stac-validator", "tests/test_data/v090/items/good_item_v090.json"],
        check=True,
    )