From 140fa9245dcfdc0d0e6cd70c0b854b8f04b84c7d Mon Sep 17 00:00:00 2001 From: blissful Date: Thu, 19 Oct 2023 21:38:51 -0400 Subject: [PATCH] flatten testdata directory --- conftest.py | 3 ++- rose/tagger_test.py | 7 ++----- testdata/{cache => }/Collage 1/Rose Gold.toml | 0 testdata/{cache => }/Test Release 1/01.m4a | Bin testdata/{cache => }/Test Release 1/02.m4a | Bin testdata/{cache => }/Test Release 1/ignorethis.file | 0 .../Test Release 2/.rose.ilovecarly.toml | 0 testdata/{cache => }/Test Release 2/01.m4a | Bin testdata/{cache => }/Test Release 2/02.m4a | Bin .../Test Release 3/.rose.ilovenewjeans.toml | 0 testdata/{cache => }/Test Release 3/01.m4a | Bin testdata/{cache => }/Test Release 3/02.m4a | Bin 12 files changed, 4 insertions(+), 6 deletions(-) rename testdata/{cache => }/Collage 1/Rose Gold.toml (100%) rename testdata/{cache => }/Test Release 1/01.m4a (100%) rename testdata/{cache => }/Test Release 1/02.m4a (100%) rename testdata/{cache => }/Test Release 1/ignorethis.file (100%) rename testdata/{cache => }/Test Release 2/.rose.ilovecarly.toml (100%) rename testdata/{cache => }/Test Release 2/01.m4a (100%) rename testdata/{cache => }/Test Release 2/02.m4a (100%) rename testdata/{cache => }/Test Release 3/.rose.ilovenewjeans.toml (100%) rename testdata/{cache => }/Test Release 3/01.m4a (100%) rename testdata/{cache => }/Test Release 3/02.m4a (100%) diff --git a/conftest.py b/conftest.py index 82664ee..33285f9 100644 --- a/conftest.py +++ b/conftest.py @@ -14,11 +14,12 @@ logger = logging.getLogger(__name__) -TESTDATA = Path(__file__).resolve().parent / "testdata" / "cache" +TESTDATA = Path(__file__).resolve().parent / "testdata" TEST_RELEASE_1 = TESTDATA / "Test Release 1" TEST_RELEASE_2 = TESTDATA / "Test Release 2" TEST_RELEASE_3 = TESTDATA / "Test Release 3" TEST_COLLAGE_1 = TESTDATA / "Collage 1" +TEST_TAGGER = TESTDATA / "tagger" @pytest.fixture(autouse=True) diff --git a/rose/tagger_test.py b/rose/tagger_test.py index b93cb83..a7ca0e7 100644 --- a/rose/tagger_test.py +++ b/rose/tagger_test.py @@ -1,12 +1,9 @@ -from pathlib import Path - import pytest +from conftest import TEST_TAGGER from rose.artiststr import Artists from rose.tagger import AudioFile, _split_tag -TESTDATA = Path(__file__).resolve().parent.parent / "testdata" / "tagger" - @pytest.mark.parametrize( ("filepath", "track_num", "duration"), @@ -19,7 +16,7 @@ ], ) def test_getters(filepath: str, track_num: str, duration: int) -> None: - tf = AudioFile.from_file(TESTDATA / filepath) + tf = AudioFile.from_file(TEST_TAGGER / filepath) assert tf.track_number == track_num assert tf.title == f"Track {track_num}" diff --git a/testdata/cache/Collage 1/Rose Gold.toml b/testdata/Collage 1/Rose Gold.toml similarity index 100% rename from testdata/cache/Collage 1/Rose Gold.toml rename to testdata/Collage 1/Rose Gold.toml diff --git a/testdata/cache/Test Release 1/01.m4a b/testdata/Test Release 1/01.m4a similarity index 100% rename from testdata/cache/Test Release 1/01.m4a rename to testdata/Test Release 1/01.m4a diff --git a/testdata/cache/Test Release 1/02.m4a b/testdata/Test Release 1/02.m4a similarity index 100% rename from testdata/cache/Test Release 1/02.m4a rename to testdata/Test Release 1/02.m4a diff --git a/testdata/cache/Test Release 1/ignorethis.file b/testdata/Test Release 1/ignorethis.file similarity index 100% rename from testdata/cache/Test Release 1/ignorethis.file rename to testdata/Test Release 1/ignorethis.file diff --git a/testdata/cache/Test Release 2/.rose.ilovecarly.toml b/testdata/Test Release 2/.rose.ilovecarly.toml similarity index 100% rename from testdata/cache/Test Release 2/.rose.ilovecarly.toml rename to testdata/Test Release 2/.rose.ilovecarly.toml diff --git a/testdata/cache/Test Release 2/01.m4a b/testdata/Test Release 2/01.m4a similarity index 100% rename from testdata/cache/Test Release 2/01.m4a rename to testdata/Test Release 2/01.m4a diff --git a/testdata/cache/Test Release 2/02.m4a b/testdata/Test Release 2/02.m4a similarity index 100% rename from testdata/cache/Test Release 2/02.m4a rename to testdata/Test Release 2/02.m4a diff --git a/testdata/cache/Test Release 3/.rose.ilovenewjeans.toml b/testdata/Test Release 3/.rose.ilovenewjeans.toml similarity index 100% rename from testdata/cache/Test Release 3/.rose.ilovenewjeans.toml rename to testdata/Test Release 3/.rose.ilovenewjeans.toml diff --git a/testdata/cache/Test Release 3/01.m4a b/testdata/Test Release 3/01.m4a similarity index 100% rename from testdata/cache/Test Release 3/01.m4a rename to testdata/Test Release 3/01.m4a diff --git a/testdata/cache/Test Release 3/02.m4a b/testdata/Test Release 3/02.m4a similarity index 100% rename from testdata/cache/Test Release 3/02.m4a rename to testdata/Test Release 3/02.m4a