emmental/tests/mpris2/test_mpris2.py
Anna Schumaker d105b15e02 mpris2: Add a Player object
This begins to implement the MediaPlayer2.Player interface. The
properties and signals are there, and I expect to fully implement them
as Emmental development goes on.

Implements: #7 ("Add MPRIS2 Support")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-04-12 10:41:42 -04:00

30 lines
988 B
Python

# Copyright 2022 (c) Anna Schumaker.
"""Test our root mpris2 object."""
import unittest
import emmental.mpris2
class TestMpris2(unittest.TestCase):
"""Test our Mpris2 Connection."""
def setUp(self):
"""Set up common variables."""
self.mpris2 = emmental.mpris2.Connection()
def tearDown(self):
"""Clean up."""
self.mpris2.disconnect()
def test_init(self):
"""Test that the Mpris Object is created properly."""
self.assertIsInstance(self.mpris2, emmental.mpris2.GObject.GObject)
self.assertIsInstance(self.mpris2.app,
emmental.mpris2.application.Application)
self.assertIsInstance(self.mpris2.player,
emmental.mpris2.player.Player)
self.assertIsNone(self.mpris2.dbus)
self.assertGreater(self.mpris2._busid, 0)
self.assertEqual(emmental.mpris2.MPRIS2_ID,
"org.mpris.MediaPlayer2.emmental-debug")