2022-05-26 17:17:03 -04:00
|
|
|
# Copyright 2022 (c) Anna Schumaker
|
|
|
|
"""Helper utilities for testing."""
|
2022-06-16 16:25:20 -04:00
|
|
|
import pathlib
|
2022-05-26 17:17:03 -04:00
|
|
|
import unittest
|
|
|
|
import emmental.db
|
2022-05-31 10:18:53 -04:00
|
|
|
from gi.repository import GObject
|
2022-05-26 17:17:03 -04:00
|
|
|
|
|
|
|
|
2022-06-16 16:25:20 -04:00
|
|
|
TRACK_OGG = pathlib.Path(__file__).parent / "track.ogg"
|
|
|
|
|
|
|
|
|
2022-05-26 17:17:03 -04:00
|
|
|
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()
|
2022-05-31 10:18:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
class FloatObject(GObject.GObject):
|
|
|
|
"""A GObject holding a Float value."""
|
|
|
|
|
|
|
|
value = GObject.Property(type=float)
|