conftest updating
This commit is contained in:
parent
785d5c9df3
commit
ffb19025db
2 changed files with 9 additions and 7 deletions
|
|
@ -2,6 +2,7 @@ import contextlib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
@ -14,13 +15,13 @@ from ytdl_sub.utils.logger import Logger
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def working_directory() -> str:
|
def working_directory() -> Path:
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
yield temp_dir
|
yield temp_dir
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def output_directory():
|
def output_directory() -> Path:
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
yield temp_dir
|
yield temp_dir
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
@ -48,11 +49,11 @@ def working_directory() -> str:
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def music_video_config_path():
|
def music_video_config_path() -> Path:
|
||||||
return "examples/music_videos_config.yaml"
|
return Path("examples/music_videos_config.yaml")
|
||||||
|
|
||||||
|
|
||||||
def _load_config(config_path: str, working_directory: str) -> ConfigFile:
|
def _load_config(config_path: Path, working_directory: Path) -> ConfigFile:
|
||||||
config_dict = load_yaml(file_path=config_path)
|
config_dict = load_yaml(file_path=config_path)
|
||||||
config_dict["configuration"]["working_directory"] = working_directory
|
config_dict["configuration"]["working_directory"] = working_directory
|
||||||
|
|
||||||
|
|
@ -75,14 +76,14 @@ def music_video_config_for_cli(music_video_config) -> str:
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def channel_as_tv_show_config(working_directory) -> ConfigFile:
|
def channel_as_tv_show_config(working_directory) -> ConfigFile:
|
||||||
return _load_config(
|
return _load_config(
|
||||||
config_path="examples/tv_show_config.yaml", working_directory=working_directory
|
config_path=Path("examples/tv_show_config.yaml"), working_directory=working_directory
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def music_audio_config(working_directory) -> ConfigFile:
|
def music_audio_config(working_directory) -> ConfigFile:
|
||||||
return _load_config(
|
return _load_config(
|
||||||
config_path="examples/music_audio_config.yaml", working_directory=working_directory
|
config_path=Path("examples/music_audio_config.yaml"), working_directory=working_directory
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue