From b8cac81b369bbb0a22db6c1442c95a1a7dad5bc0 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 17 Apr 2022 22:35:33 +0200 Subject: tests: Add wait_for_shutdown unit test --- tests/test_mpv.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/test_mpv.py') diff --git a/tests/test_mpv.py b/tests/test_mpv.py index b8c81aa..7c0373d 100755 --- a/tests/test_mpv.py +++ b/tests/test_mpv.py @@ -640,7 +640,18 @@ class TestLifecycle(unittest.TestCase): m.terminate() 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): handler = mock.Mock() self.disp = Xvfb() -- cgit