Anna Schumaker
ee8db58fb2
And use it to track the existence of artwork for the current file. This could either be a cover.jpg file in the same directory as the currently playing track or embedded artwork found in the Gst.TagList. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
31 lines
789 B
Python
31 lines
789 B
Python
# Copyright 2022 (c) Anna Schumaker
|
|
"""Helper utilities for testing."""
|
|
import pathlib
|
|
import unittest
|
|
import emmental.db
|
|
from gi.repository import GObject
|
|
from gi.repository import GLib
|
|
|
|
|
|
TRACK_OGG = pathlib.Path(__file__).parent / "track.ogg"
|
|
COVER_JPG = pathlib.Path(__file__).parent / "cover.jpg"
|
|
COVER_JPG_BYTES = GLib.Bytes(COVER_JPG.open("rb").read())
|
|
|
|
|
|
class TestCase(unittest.TestCase):
|
|
"""A TestCase that handles database setup and cleanup."""
|
|
|
|
def setUp(self):
|
|
"""Set up a database connection."""
|
|
self.sql = emmental.db.Connection()
|
|
|
|
def tearDown(self):
|
|
"""Clean up the database connection."""
|
|
self.sql.close()
|
|
|
|
|
|
class FloatObject(GObject.GObject):
|
|
"""A GObject holding a Float value."""
|
|
|
|
value = GObject.Property(type=float)
|