20 lines
578 B
Python
20 lines
578 B
Python
# Copyright 2019 (c) Anna Schumaker.
|
|
from . import audio
|
|
import curds
|
|
import os
|
|
import unittest
|
|
from gi.repository import Gst
|
|
|
|
test_album = os.path.abspath("./trier/Test Library/Test Artist 01/Test Album 1")
|
|
|
|
class TestAudio(unittest.TestCase):
|
|
def test_play_track(self):
|
|
path = os.path.join(test_album, "01 - Test Track 01.ogg")
|
|
track = curds.trak.lookup(path)
|
|
|
|
self.assertEqual(audio.playbin.get_state(), Gst.State.NULL)
|
|
audio.play_track(track)
|
|
self.assertEqual(audio.playbin.get_state(), Gst.State.PLAYING)
|
|
|
|
audio.reset()
|