@@ -170,20 +170,23 @@ class TestModelConnect(asynctest.TestCase):
170170 @pytest .mark .asyncio
171171 async def test_no_args (self , mock_connect_model , _ ):
172172 m = Model ()
173+ mock_connect_model .side_effect = [("_" , "uuid" )]
173174 await m .connect ()
174175 mock_connect_model .assert_called_once_with (None )
175176
176177 @asynctest .patch ('juju.client.connector.Connector.connect_model' )
177178 @pytest .mark .asyncio
178179 async def test_with_model_name (self , mock_connect_model , _ ):
179180 m = Model ()
181+ mock_connect_model .side_effect = [("_" , "uuid" )]
180182 await m .connect (model_name = 'foo' )
181183 mock_connect_model .assert_called_once_with ('foo' )
182184
183185 @asynctest .patch ('juju.client.connector.Connector.connect_model' )
184186 @pytest .mark .asyncio
185187 async def test_with_endpoint_but_no_uuid (self , mock_connect_model , _ ):
186188 m = Model ()
189+ mock_connect_model .side_effect = [("_" , "uuid" )]
187190 with self .assertRaises (TypeError ):
188191 await m .connect (endpoint = '0.1.2.3:4566' )
189192 self .assertEqual (mock_connect_model .call_count , 0 )
@@ -251,6 +254,7 @@ async def test_with_endpoint_and_uuid_with_macaroon(self, mock_connect, _):
251254 @asynctest .patch ('juju.client.connector.Connector.connect' )
252255 async def test_with_posargs (self , mock_connect , mock_connect_model , _ ):
253256 m = Model ()
257+ mock_connect_model .side_effect = [("_" , "uuid" )]
254258 await m .connect ('foo' )
255259 mock_connect_model .assert_called_once_with ('foo' )
256260 with self .assertRaises (TypeError ):
0 commit comments