File: test_show_versions.py

package info (click to toggle)
rasterio 1.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,740 kB
  • sloc: python: 22,519; makefile: 274; sh: 164; xml: 29
file content (46 lines) | stat: -rw-r--r-- 1,090 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from rasterio._show_versions import (
    _get_deps_info,
    _get_gdal_info,
    _get_sys_info,
    show_versions,
)


def test_get_gdal_info():
    yagdal_info = _get_gdal_info()
    assert "rasterio" in yagdal_info
    assert "GDAL" in yagdal_info
    assert "PROJ" in yagdal_info
    assert "GEOS" in yagdal_info
    assert "PROJ DATA" in yagdal_info
    assert "GDAL DATA" in yagdal_info


def test_get_sys_info():
    sys_info = _get_sys_info()

    assert "python" in sys_info
    assert "executable" in sys_info
    assert "machine" in sys_info


def test_get_deps_info():
    deps_info = _get_deps_info()

    assert "affine" in deps_info
    assert "attrs" in deps_info
    assert "certifi" in deps_info
    assert "click" in deps_info
    assert "cligj" in deps_info
    assert "cython" in deps_info
    assert "numpy" in deps_info
    assert "setuptools" in deps_info


def test_show_versions_with_gdal(capsys):
    show_versions()
    out, err = capsys.readouterr()
    assert "System" in out
    assert "python" in out
    assert "GDAL" in out
    assert "Python deps" in out