File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change
1
+ import asyncio
1
2
import logging
2
3
from unittest .mock import Mock , sentinel
3
4
4
5
from mopidy_mpd import dispatcher , network , session
5
6
7
+ loop = asyncio .new_event_loop ()
8
+ asyncio .set_event_loop (loop )
9
+
6
10
7
11
def test_on_start_logged (caplog ):
8
12
caplog .set_level (logging .INFO )
@@ -13,6 +17,7 @@ def test_on_start_logged(caplog):
13
17
core = None ,
14
18
uri_map = None ,
15
19
connection = connection ,
20
+ loop = loop ,
16
21
).on_start ()
17
22
18
23
assert f"New MPD connection from { connection } " in caplog .text
@@ -26,6 +31,7 @@ def test_on_line_received_logged(caplog):
26
31
core = None ,
27
32
uri_map = None ,
28
33
connection = connection ,
34
+ loop = loop ,
29
35
)
30
36
mpd_session .dispatcher = Mock (spec = dispatcher .MpdDispatcher )
31
37
mpd_session .dispatcher .handle_request .return_value = [str (sentinel .resp )]
You can’t perform that action at this time.
0 commit comments