2021-05-29 17:48:35 +02:00
|
|
|
import shutil
|
2021-06-04 14:07:09 +02:00
|
|
|
from tempfile import TemporaryDirectory
|
2021-06-04 14:06:02 +02:00
|
|
|
|
|
|
|
import pytest
|
2022-02-15 10:33:17 +01:00
|
|
|
from libretime_shared.logging import TRACE, setup_logger
|
2021-05-29 17:48:35 +02:00
|
|
|
|
2021-08-30 21:23:48 +02:00
|
|
|
from .fixtures import fixtures_path
|
|
|
|
|
2022-02-15 10:33:17 +01:00
|
|
|
setup_logger(TRACE)
|
|
|
|
|
2021-08-30 21:23:48 +02:00
|
|
|
AUDIO_FILENAME = "s1-stereo-tagged.mp3"
|
|
|
|
AUDIO_FILE = fixtures_path / AUDIO_FILENAME
|
|
|
|
AUDIO_IMPORT_DEST = f"Test Artist/Test Album/{AUDIO_FILENAME}"
|
2021-05-29 17:48:35 +02:00
|
|
|
|
2021-06-04 14:07:09 +02:00
|
|
|
# TODO: Use pathlib for file manipulation
|
|
|
|
|
2021-05-29 17:48:35 +02:00
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def dest_dir():
|
2021-06-04 14:07:09 +02:00
|
|
|
with TemporaryDirectory(prefix="dest") as tmpdir:
|
2021-05-29 17:48:35 +02:00
|
|
|
yield tmpdir
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def src_dir():
|
2021-06-04 14:07:09 +02:00
|
|
|
with TemporaryDirectory(prefix="src") as tmpdir:
|
2021-05-29 17:48:35 +02:00
|
|
|
shutil.copy(AUDIO_FILE, tmpdir)
|
|
|
|
yield tmpdir
|