use pathlib.Path for directories and files
This commit is contained in:
parent
110ddaf3a1
commit
8162758cec
13 changed files with 137 additions and 125 deletions
|
|
@ -5,21 +5,21 @@ from pathlib import Path
|
|||
|
||||
def test_init_folders(tmp_path: Path) -> None:
|
||||
dataset_path = tmp_path / "test_dataset"
|
||||
init.create(str(dataset_path))
|
||||
init.create(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: Path) -> None:
|
||||
dataset_path = tmp_path / "test_dataset"
|
||||
init.create(str(dataset_path), tracker="None")
|
||||
init.create(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: Path) -> None:
|
||||
dataset_path = tmp_path / "test_dataset"
|
||||
init.create(str(dataset_path), tracker="None")
|
||||
init.create(dataset_path, tracker="None")
|
||||
config_path = dataset_path / ".corrlib"
|
||||
assert os.path.exists(str(config_path))
|
||||
from configparser import ConfigParser
|
||||
|
|
@ -37,7 +37,7 @@ def test_init_config(tmp_path: Path) -> None:
|
|||
|
||||
def test_init_db(tmp_path: Path) -> None:
|
||||
dataset_path = tmp_path / "test_dataset"
|
||||
init.create(str(dataset_path))
|
||||
init.create(dataset_path)
|
||||
assert os.path.exists(str(dataset_path / "backlogger.db"))
|
||||
conn = sql.connect(str(dataset_path / "backlogger.db"))
|
||||
cursor = conn.cursor()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue