Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ test/*.gpkg
coverage.xml
htmlcov/

# === Testdaten: Sidecar-Dateien, die QGIS/GDAL beim Lesen selbst anlegt ===
# Testdaten/ selbst ist bewusst eingecheckt (siehe docs/test-strategy.md),
# aber diese Dateien entstehen erst beim Testlauf und gehoeren nicht ins Repo.
*.qix
*.shp.xml
Testdaten/**/*.gpkg

# Ablage fuer aussortierte Testdaten, die noch nicht geloescht wurden.
_to_delete/

# === QGIS Plugin generierte Dateien ===
# Kompilierte Übersetzungen (*.qm) sind Build-Artefakte aus i18n/*.ts.
# resources.py wird bewusst NICHT ignoriert - siehe Hinweis unten.
Expand Down
Binary file modified Testdaten/ALKIS Gebäude/GebauedeBauwerk.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb01_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb01_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb01_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb01_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/geb01_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb01_l.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb01_l.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb01_l.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb01_l.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/geb01_l.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb02_p.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb02_p.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb02_p.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb02_p.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/geb02_p.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb03_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb03_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/geb03_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/geb03_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/geb03_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/gew02_p.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/gew02_p.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/gew02_p.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/gew02_p.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/gew02_p.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/gew03_l.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/gew03_l.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/gew03_l.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/gew03_l.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/gew03_l.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/hdu01_b.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/hdu01_b.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/hdu01_b.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/hdu01_b.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/hdu01_b.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/rel01_l.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/rel01_l.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/rel01_l.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/rel01_l.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/rel01_l.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie01_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie01_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie01_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie01_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/sie01_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie02_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie02_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie02_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie02_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/sie02_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie03_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie03_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie03_l.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_l.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie03_l.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_l.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_l.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie03_p.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_p.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/sie03_p.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_p.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/sie03_p.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg01_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg01_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg01_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg01_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/veg01_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg04_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg04_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg04_l.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_l.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg04_l.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_l.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_l.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg04_p.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_p.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/veg04_p.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_p.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/veg04_p.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver01_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver01_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver01_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver01_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/ver01_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver03_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver03_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver03_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver03_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/ver03_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver06_f.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_f.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver06_f.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_f.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_f.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver06_l.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_l.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver06_l.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_l.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_l.shx
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver06_p.cpg

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_p.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion Testdaten/ATKIS Basis DLM dataset/ver06_p.prj

This file was deleted.

Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_p.shp
Binary file not shown.
Binary file removed Testdaten/ATKIS Basis DLM dataset/ver06_p.shx
Binary file not shown.
110 changes: 0 additions & 110 deletions basis-dlm-aaa_ebenen_inhalt.csv

This file was deleted.

5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ via IBTool's own **Check** button) stay outside the plugin.

## Out of Scope

- **`Part` (partitioning layer)** — produced by a separate, dedicated
tool; Data Wizard doesn't touch it.
- **`Part` (partitioning layer)** — produced by the sibling plugin
**[IB-Tool (Partitioning)](https://github.com/IB-Tool/ibtoolpartion)**;
Data Wizard doesn't touch it.
- **Filter file** — a separately maintained, largely static file; Data
Wizard doesn't touch it.
- **Validation** — Data Wizard does not re-implement IBTool's
Expand Down
66 changes: 65 additions & 1 deletion test/config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
"""Central test configuration for Data Wizard.

Single source of truth for two things:

1. The local QGIS bootstrap (``apply_qgis_environment``), applied from
``test/__init__.py`` before anything imports ``qgis``.
2. The location of the committed test data under ``Testdaten/`` and the
``requires_atkis_testdaten`` skip marker derived from it.

Everything path-related is driven by ``test_config.ini`` so the layout is
declared in exactly one place. Test modules must not re-derive these paths —
import them from here instead.
"""

import configparser
import os
import sys
from pathlib import Path

import pytest

CONFIG_FILE = Path(__file__).parent / 'test_config.ini'

parser = configparser.ConfigParser()
parser.read(CONFIG_FILE)
# Explicit UTF-8: the [testdata] paths contain umlauts ("ALKIS Gebäude"), and
# configparser would otherwise fall back to the platform encoding (cp1252 on
# Windows), which makes the file non-portable.
parser.read(CONFIG_FILE, encoding='utf-8')

QGIS_PREFIX_PATH = parser.get('qgis', 'prefix_path', fallback=r'C:\\Program Files\\QGIS 3.40.0')

Expand All @@ -26,3 +45,48 @@ def apply_qgis_environment():
p_str = str(p)
if os.path.exists(p_str) and p_str not in sys.path:
sys.path.insert(0, p_str)


# ---------------------------------------------------------------------------
# Committed test data (Testdaten/)
# ---------------------------------------------------------------------------

#: Root of the committed test data.
TESTDATEN_DIR = PROJECT_ROOT / parser.get('testdata', 'dir', fallback='Testdaten')

#: Folder holding the flat ATKIS Basis-DLM shapefiles. processor._load_shp
#: does not search recursively, so this must be the folder that directly
#: contains ver01_l.shp etc. — it is what gets passed as source_dir.
ATKIS_DIR = TESTDATEN_DIR / parser.get(
'testdata', 'atkis_subdir', fallback='ATKIS Basis DLM dataset')

#: Building footprint file passed as hu_path.
HU_SHP = TESTDATEN_DIR / parser.get(
'testdata', 'hu_file', fallback='ALKIS Gebäude/GebauedeBauwerk.shp')

#: The seven ATKIS source layers processor.process_atkis reads. Keep in sync
#: with processor._process_rn / _process_aux.
ATKIS_LAYERS = ('ver01_l', 'ver02_l', 'ver03_l', 'veg02_f', 'veg03_f',
'gew01_f', 'gew01_l')

#: True when the full extract is present and the end-to-end tests can run.
ATKIS_DATA_AVAILABLE = (
ATKIS_DIR.is_dir()
and all((ATKIS_DIR / f'{name}.shp').exists() for name in ATKIS_LAYERS)
and HU_SHP.exists()
)

TESTDATA_SKIP_REASON = (
f"Test data incomplete - expected the seven ATKIS layers in {ATKIS_DIR} "
f"and the building footprints at {HU_SHP}. See docs/test-strategy.md."
)

#: Shared skip marker for every test that needs the real ATKIS/ALKIS extract.
requires_atkis_testdaten = pytest.mark.skipif(
not ATKIS_DATA_AVAILABLE, reason=TESTDATA_SKIP_REASON)


def missing_atkis_layers():
"""Return the ATKIS layer names absent from ATKIS_DIR (empty when complete)."""
return [name for name in ATKIS_LAYERS
if not (ATKIS_DIR / f'{name}.shp').exists()]
14 changes: 14 additions & 0 deletions test/test_config.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
; Local test configuration for Data Wizard (UTF-8).
;
; [qgis] is only consulted for local runs; the Docker image sets
; QGIS_PREFIX_PATH=/usr itself.
;
; [testdata] declares the layout of the committed Testdaten/ folder. This is
; the single place where those paths are defined - test/config.py reads them
; and test modules import the resulting constants from there.

[qgis]
prefix_path = C:\\Program Files\\QGIS 3.40.0

[testdata]
dir = Testdaten
atkis_subdir = ATKIS Basis DLM dataset
hu_file = ALKIS Gebäude/GebauedeBauwerk.shp
Loading
Loading