File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """
2+ Get a package path and check its content.
3+
4+ The package content checking is processed by a series/pipeline of tasks
5+ on specific request or automatically (if None asked) after parsing/interpreting
6+ the package name, or greedly inpecting any of the expected directories.
7+ """
8+ import os
9+ import sys
10+ import pytest
11+
12+ import gpt
13+ import check
14+
15+
16+ _data = {
17+ 'gpkg' : None
18+ }
19+
20+
21+ # def find_gpkg(pkg_path):
22+ # pkg_name = os.path.basename(os.path.abspath(pkg_path))
23+ # pkg_specs = parse_package_name(pkg_name)
24+ # pkg_specs['name'] = pkg_name
25+ # return os.path.join(pkg_path, 'vector', pkg_specs['name']+'.gpkg')
26+
27+ @pytest .fixture ()
28+ def geopkg_path (pytestconfig ):
29+ return pytestconfig .getoption ('pkgpath' )
30+
31+ @pytest .fixture ()
32+ def gpkg ():
33+ return _data ['gpkg' ]
34+
35+ def test_00 (geopkg_path ):
36+ assert os .path .exists (geopkg_path ), "Geopackage file/path NOT found."
37+ gpkg = gpt .read_file (geopkg_path )
38+ assert gpkg
39+ _data ['gpkg' ] = gpkg
40+
41+ # def test_geopackage():
42+ # out = check.geopackage(_data['gpkg'])
43+
44+ def test_layer_names (gpkg ):
45+ res = check .check_layer_names (gpkg )
46+ assert res
47+
48+ def test_field_names (gpkg ):
49+ res = check .check_field_names (gpkg )
50+ assert res
51+
52+ def test_geometry (gpkg ):
53+ res = check .check_geometry (gpkg )
54+ assert res
55+
56+ def test_crs (gpkg ):
57+ res = check .check_crs (gpkg )
58+ assert res
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments