tests: Add wait_for_shutdown unit test
This commit is contained in:
parent
7459d3df04
commit
b8cac81b36
1 changed files with 12 additions and 1 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue