add typing for tests

This commit is contained in:
Justus Kuhlmann 2026-02-18 10:59:12 +01:00
commit 14d19ce9dd
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
5 changed files with 19 additions and 17 deletions

View file

@ -1,22 +1,23 @@
import corrlib.initialization as init
import os
import sqlite3 as sql
from pathlib import Path
def test_init_folders(tmp_path):
def test_init_folders(tmp_path: Path) -> None:
dataset_path = tmp_path / "test_dataset"
init.create(str(dataset_path))
assert os.path.exists(str(dataset_path))
assert os.path.exists(str(dataset_path / "backlogger.db"))
def test_init_folders_no_tracker(tmp_path):
def test_init_folders_no_tracker(tmp_path: Path) -> None:
dataset_path = tmp_path / "test_dataset"
init.create(str(dataset_path), tracker="None")
assert os.path.exists(str(dataset_path))
assert os.path.exists(str(dataset_path / "backlogger.db"))
def test_init_config(tmp_path):
def test_init_config(tmp_path: Path) -> None:
dataset_path = tmp_path / "test_dataset"
init.create(str(dataset_path), tracker="None")
config_path = dataset_path / ".corrlib"
@ -34,7 +35,7 @@ def test_init_config(tmp_path):
assert config.get("paths", "import_scripts_path") == "import_scripts"
def test_init_db(tmp_path):
def test_init_db(tmp_path: Path) -> None:
dataset_path = tmp_path / "test_dataset"
init.create(str(dataset_path))
assert os.path.exists(str(dataset_path / "backlogger.db"))