File: test_cli_main.py

package info (click to toggle)
rasterio 1.4.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,760 kB
  • sloc: python: 22,520; makefile: 275; sh: 164; xml: 29
file content (18 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Tests CLI command version and entry points."""

import rasterio
from rasterio.rio.main import entry_points, main_group


def test_version(runner):
    result = runner.invoke(main_group, ['--version'])
    assert result.exit_code == 0
    assert rasterio.__version__ in result.output


def test_all_registered():
    # This test makes sure that all of the subcommands defined in the
    # rasterio.rio_commands entry-point are actually registered to the main
    # cli group.
    for ep in entry_points(group="rasterio.rio_commands"):
        assert ep.name in main_group.commands