File: test_config.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 (30 lines) | stat: -rw-r--r-- 1,149 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
26
27
28
29
30
from stac_validator.validate import StacValidate


def test_validator_with_test_config():
    validator = StacValidate(
        stac_file="tests/test_data/v100/core-item.json",
        schema_config="schema_config.yaml",
    )
    valid = validator.run()
    assert valid
    # Optionally, check that the schema path in output is as expected
    assert validator.message[-1]["schema"] == ["local_schemas/v1.0.0/item.json"]


def test_validator_with_test_config_eo():
    validator = StacValidate(
        stac_file="tests/test_data/v100/extended-item.json",
        schema_config="schema_config.yaml",
    )
    valid = validator.run()
    assert valid
    # Optionally, check that the schema path in output is as expected
    assert validator.message[-1]["schema"] == [
        "local_schemas/v1.0.0/extensions/eo.json",
        "local_schemas/v1.0.0/extensions/projection.json",
        "https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
        "https://stac-extensions.github.io/view/v1.0.0/schema.json",
        "https://stac-extensions.github.io/remote-data/v1.0.0/schema.json",
        "local_schemas/v1.0.0/item.json",
    ]