tests: Add wait_for_shutdown unit test

This commit is contained in:
jaseg 2022-04-17 22:35:33 +02:00
parent 7459d3df04
commit b8cac81b36

View file

@ -640,7 +640,18 @@ class TestLifecycle(unittest.TestCase):
m.terminate() m.terminate()
self.disp.stop() self.disp.stop()
@devnull_libmpv() def test_wait_for_shutdown(self):
self.disp = Xvfb()
self.disp.start()
handler = mock.Mock()
m = mpv.MPV()
m.play(TESTVID)
with self.assertRaises(mpv.ShutdownError):
with m.prepare_and_wait_for_event(None) as result:
m.terminate()
result.result()
self.disp.stop()
def test_log_handler(self): def test_log_handler(self):
handler = mock.Mock() handler = mock.Mock()
self.disp = Xvfb() self.disp = Xvfb()