Move testing tracks into data/
And the generate_tracks.py script into tools/ Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
d985c53c5c
commit
e8f9427750
20
Makefile
20
Makefile
|
@ -2,22 +2,10 @@
|
|||
|
||||
clean:
|
||||
find . -type d -name __pycache__ -exec rm -r {} \+
|
||||
find trier -type d -name "Test Album" -exec rm -r {} \+
|
||||
find trier -type d -name "Test Library" -exec rm -r {} \+
|
||||
|
||||
.PHONY: trier
|
||||
trier:
|
||||
python trier/generate_tracks.py
|
||||
EMMENTAL_TESTING=1 python -m unittest discover -v
|
||||
find data/ -type d -name "Test Album" -exec rm -r {} \+
|
||||
find data/ -type d -name "Test Library" -exec rm -r {} \+
|
||||
|
||||
.PHONY: tests
|
||||
tests:
|
||||
python trier/generate_tracks.py
|
||||
find `pwd` -name 'test_*.py' -not -path '*/curds/*' -not -path '*/rind/*' -not -path '*test_emmental.py' \
|
||||
| EMMENTAL_TESTING=1 xargs python -m unittest -v
|
||||
|
||||
.PHONY:cover
|
||||
cover:
|
||||
python trier/generate_tracks.py
|
||||
EMMENTAL_TESTING=1 coverage run -m unittest discover -v
|
||||
coverage report -m
|
||||
python tools/generate_tracks.py
|
||||
EMMENTAL_TESTING=1 python -m unittest discover -v
|
||||
|
|
|
@ -11,7 +11,7 @@ import pathlib
|
|||
import trackdb
|
||||
import unittest
|
||||
|
||||
test_album = pathlib.Path("./trier/Test Album/")
|
||||
test_album = pathlib.Path("./data/Test Album/")
|
||||
test_track = test_album / "01 - Test Track.ogg"
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ from . import metadata
|
|||
import pathlib
|
||||
import unittest
|
||||
|
||||
test_tracks = pathlib.Path("./trier/Test Album")
|
||||
test_tracks = pathlib.Path("./data/Test Album")
|
||||
track_01 = test_tracks / "01 - Test Track.ogg"
|
||||
track_02 = test_tracks / "02 - Test {Disc 2}.ogg"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import trackdb
|
|||
import unittest
|
||||
|
||||
main_context = GLib.main_context_default()
|
||||
test_library = pathlib.Path("./trier/Test Library").absolute()
|
||||
test_library = pathlib.Path("./data/Test Library").absolute()
|
||||
test_artist1 = test_library / "Test Artist 01"
|
||||
|
||||
class TestLibrarySidebar(unittest.TestCase):
|
||||
|
|
|
@ -4,7 +4,7 @@ import pathlib
|
|||
import trackdb
|
||||
import unittest
|
||||
|
||||
test_tracks = pathlib.Path("./trier/Test Album")
|
||||
test_tracks = pathlib.Path("./data/Test Album")
|
||||
|
||||
class TestLibraryTag(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
|
|
|
@ -6,7 +6,7 @@ import mutagen.id3
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
trier = os.path.abspath("trier")
|
||||
data = os.path.abspath("data")
|
||||
ffmpeg = "ffmpeg -hide_banner -nostdin -f s16le -i /dev/zero -codec libvorbis -loglevel warning".split()
|
||||
|
||||
image = mutagen.flac.Picture()
|
||||
|
@ -21,7 +21,7 @@ image_data = encoded_data.decode("ascii")
|
|||
|
||||
|
||||
def generate_track(length, filename, tags={}):
|
||||
path = os.path.join(trier, filename)
|
||||
path = os.path.join(data, filename)
|
||||
if os.path.exists(path):
|
||||
return
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
|
@ -74,7 +74,7 @@ generate_track(60, "Test Album/11 - Test Track 11.ogg", { "Title" : "Test Track
|
|||
"album" : "Test Album 11",
|
||||
"discnumber" : "1",
|
||||
"tracknumber" : "11" })
|
||||
with open(os.path.join(trier, "Test Album/text.txt"), 'w') as f:
|
||||
with open(os.path.join(data, "Test Album/text.txt"), 'w') as f:
|
||||
f.write("Test Text")
|
||||
|
||||
# Create a giant library for testing
|
|
@ -5,7 +5,7 @@ import pathlib
|
|||
import threading
|
||||
import unittest
|
||||
|
||||
test_tracks = pathlib.Path("./trier/Test Album")
|
||||
test_tracks = pathlib.Path("./data/Test Album")
|
||||
|
||||
class FakeLibrary:
|
||||
def __init__(self):
|
||||
|
|
|
@ -7,7 +7,7 @@ import datetime
|
|||
import pathlib
|
||||
import unittest
|
||||
|
||||
test_tracks = pathlib.Path("./trier/Test Album")
|
||||
test_tracks = pathlib.Path("./data/Test Album")
|
||||
|
||||
class FakeLibrary:
|
||||
def __init__(self):
|
||||
|
|
Loading…
Reference in New Issue