File: test_update_geometry.py

package info (click to toggle)
stactools 0.5.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,796 kB
  • sloc: python: 4,498; xml: 554; sh: 395; makefile: 34
file content (22 lines) | stat: -rw-r--r-- 682 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
import shutil
from pathlib import Path

from click.testing import CliRunner
from stactools.cli.cli import cli

from tests import test_data


def test_update_geometry(tmp_path: Path) -> None:
    item_path = test_data.get_path(
        "data-files/raster_footprint/LC08_L1TP_198029_20220331_20220406_02_T1_B2.json"
    )
    asset_path = test_data.get_path(
        "data-files/raster_footprint/LC08_L1TP_198029_20220331_20220406_02_T1_B2.TIF"
    )
    item_path = shutil.copy(item_path, str(tmp_path))
    asset_path = shutil.copy(asset_path, str(tmp_path))

    runner = CliRunner()
    result = runner.invoke(cli, ["update-geometry", item_path])
    assert result.exit_code == 0