@@ -25,7 +25,7 @@ def __init__(self):
2525 self .close = mock .MagicMock ()
2626
2727 @classmethod
28- def setup_BaseTransport (self ):
28+ async def setup_BaseTransport (self ):
2929 """Create base object."""
3030 base = BaseTransport (
3131 self .base_comm_name ,
@@ -40,9 +40,9 @@ def setup_BaseTransport(self):
4040 base .cb_handle_data = mock .MagicMock ()
4141 return base
4242
43- def test_properties (self ):
43+ async def test_properties (self ):
4444 """Test properties."""
45- base = self .setup_BaseTransport ()
45+ base = await self .setup_BaseTransport ()
4646 assert self .base_comm_name == base .comm_name
4747 assert self .base_framer == base .framer
4848 assert self .base_reconnect_delay == base .reconnect_delay
@@ -53,16 +53,16 @@ def test_properties(self):
5353
5454 async def test_magic (self ):
5555 """Test properties."""
56- base = self .setup_BaseTransport ()
56+ base = await self .setup_BaseTransport ()
5757 base .close = mock .MagicMock ()
5858 async with base :
5959 pass
6060 base .close .assert_called_once ()
6161 assert str (base ) == f"BaseTransport({ self .base_comm_name } )"
6262
63- def test_connection_made (self ):
63+ async def test_connection_made (self ):
6464 """Test properties."""
65- base = self .setup_BaseTransport ()
65+ base = await self .setup_BaseTransport ()
6666 transport = self .dummy_transport ()
6767 base .connection_made (transport )
6868 assert base .transport == transport
@@ -73,9 +73,9 @@ def test_connection_made(self):
7373 base .cb_handle_data .assert_not_called ()
7474 base .close ()
7575
76- def test_connection_lost (self ):
76+ async def test_connection_lost (self ):
7777 """Test properties."""
78- base = self .setup_BaseTransport ()
78+ base = await self .setup_BaseTransport ()
7979 transport = self .dummy_transport ()
8080 base .connection_lost (transport )
8181 assert not base .transport
@@ -86,9 +86,9 @@ def test_connection_lost(self):
8686 base .cb_handle_data .assert_not_called ()
8787 base .close ()
8888
89- def test_close_simple (self ):
89+ async def test_close_simple (self ):
9090 """Test properties."""
91- base = self .setup_BaseTransport ()
91+ base = await self .setup_BaseTransport ()
9292 transport = self .dummy_transport ()
9393 base .connection_made (transport )
9494 base .cb_connection_made .reset_mock ()
@@ -105,9 +105,9 @@ def test_close_simple(self):
105105 assert not base .recv_buffer
106106 assert not base .reconnect_timer
107107
108- def test_close_reconnect (self ):
108+ async def test_close_reconnect (self ):
109109 """Test properties."""
110- base = self .setup_BaseTransport ()
110+ base = await self .setup_BaseTransport ()
111111 transport = self .dummy_transport ()
112112 base .connection_made (transport )
113113 base .reconnect_timer = None
@@ -116,16 +116,16 @@ def test_close_reconnect(self):
116116 base .close ()
117117 assert not base .reconnect_timer
118118
119- def test_reset_delay (self ):
119+ async def test_reset_delay (self ):
120120 """Test properties."""
121- base = self .setup_BaseTransport ()
121+ base = await self .setup_BaseTransport ()
122122 base .reconnect_delay_current = self .base_reconnect_delay + 1
123123 base .reset_delay ()
124124 assert base .reconnect_delay_current == self .base_reconnect_delay
125125
126126 async def test_connect (self ):
127127 """Test properties."""
128- base = self .setup_BaseTransport ()
128+ base = await self .setup_BaseTransport ()
129129 base .reconnect_delay_current = self .base_reconnect_delay + 1
130130 base .close (reconnect = True )
131131 base .complete_connect ()
@@ -139,7 +139,7 @@ async def test_connect(self):
139139
140140 async def test_reconnect (self ):
141141 """Test properties."""
142- base = self .setup_BaseTransport ()
142+ base = await self .setup_BaseTransport ()
143143 transport = self .dummy_transport ()
144144 base .connection_made (transport )
145145 base .connect = mock .MagicMock ()
@@ -151,15 +151,15 @@ async def test_reconnect(self):
151151
152152 async def test_datagram (self ):
153153 """Test properties."""
154- base = self .setup_BaseTransport ()
154+ base = await self .setup_BaseTransport ()
155155 base .data_received = mock .MagicMock ()
156156 base .datagram_received (b"abc" , "127.0.0.1" )
157157 base .data_received .assert_called_once ()
158158 base .close ()
159159
160160 async def test_receive (self ):
161161 """Test properties."""
162- base = self .setup_BaseTransport ()
162+ base = await self .setup_BaseTransport ()
163163 base .cb_handle_data = mock .MagicMock (return_value = 2 )
164164 base .data_received (b"123456" )
165165 base .cb_handle_data .assert_called_once ()
@@ -170,6 +170,6 @@ async def test_receive(self):
170170
171171 async def test_send (self ):
172172 """Test properties."""
173- base = self .setup_BaseTransport ()
173+ base = await self .setup_BaseTransport ()
174174 await base .send (b"abc" )
175175 base .close ()
0 commit comments