1
0
Fork
You've already forked koh
0
forked from comaps/kothic
bmgru koh
  • Python 59%
  • HTML 40.9%
Find a file
bmgru c37c1eb90d csvcss example
Signed-off-by: bmgru <bmgru@noreply.codeberg.org>
2026年03月11日 17:53:41 +01:00
integration-tests Added unit tests and integration tests 2024年12月13日 18:21:11 +02:00
src csvcss example 2026年03月11日 17:53:41 +01:00
styles csvcss example 2026年03月11日 17:53:41 +01:00
tests Added unit tests and integration tests 2024年12月13日 18:21:11 +02:00
.gitignore Added unit tests and integration tests 2024年12月13日 18:21:11 +02:00
.hgignore Changeable vector backends. 2010年05月02日 00:18:15 +03:00
README.md csvcss example 2026年03月11日 17:53:41 +01:00
requirements.txt Require protobuf 3.21+ 2024年12月02日 01:02:50 +03:00

Kothic Mapcss parser/processor tailored for Comaps use.

Dependencies:

  • Python >= 3.8

Python dependencies:

pip3 install -r requirements.txt

Running unittests

To run all unittests execute next command from project root folder:

python3 -m unittest discover -s tests

this will search for all test*.py files within tests directory and execute tests from those files.

Running integration tests

File integration-tests/full_drules_gen.py is intended to generate drules files for all 6 themes from main Comaps repo. It could be used to understand which parts of the project are actually used by Comaps repo.

Usage:

cd <comaps directory>
mkdir -p ../drulestest # create local test directory
python3 tools/kothic/integration-tests/full_drules_gen.py -d data o ../drulestest --txt

This command will run generation for styles - default light, default dark, outdoors light, outdoors dark, vehicle light, vehicle dark and put *.bin and *.txt files into '../drulestest' subfolder.

Test usage of Csvcss solution

The goal is to check than when re-writing styles using Csvcss, the result is absolutely the same

Step1: generate reference output

cd <comaps directory>
mkdir -p ../drulesref # create directory for reference results
python3 tools/kothic/integration-tests/full_drules_gen.py -d data -o ../drulesref --txt

Step2 : generate new result

make a backup copy of data/styles to data/styles-save
modify styles, using Csvcss solution

cd <comaps directory>
mkdir -p ../drulesnew # create directory for new results
python3 tools/kothic/integration-tests/full_drules_gen.py -d data -o ../drulesnew --txt

Step3 compare

diff ../drulesref/outdoors_light.txt ../drulesnew/outdoors_light.txt

do the same for other files