@@ -64,11 +64,9 @@ def test_create_tap_mirror(self):
6464 fake_tap_mirror = sdk_fakes .generate_fake_resource (
6565 tap_mirror .TapMirror , ** {'port_id' : port_id , 'directions' : 'IN=99' }
6666 )
67- self .app .client_manager .network .create_tap_mirror .return_value = (
68- fake_tap_mirror
69- )
70- self .app .client_manager .network .find_port .return_value = fake_port
71- self .app .client_manager .network .find_tap_mirror .side_effect = (
67+ self .network_client .create_tap_mirror .return_value = fake_tap_mirror
68+ self .network_client .find_port .return_value = fake_port
69+ self .network_client .find_tap_mirror .side_effect = (
7270 lambda _ , name_or_id : {'id' : name_or_id }
7371 )
7472 arg_list = [
@@ -96,13 +94,10 @@ def test_create_tap_mirror(self):
9694 ]
9795
9896 parsed_args = self .check_parser (self .cmd , arg_list , verify_list )
99- self .app .client_manager .network .find_tap_mirror .return_value = (
100- fake_tap_mirror
101- )
97+ self .network_client .find_tap_mirror .return_value = fake_tap_mirror
10298
10399 columns , data = self .cmd .take_action (parsed_args )
104- create_tap_m_mock = self .app .client_manager .network .create_tap_mirror
105- create_tap_m_mock .assert_called_once_with (
100+ self .network_client .create_tap_mirror .assert_called_once_with (
106101 ** {
107102 'name' : fake_tap_mirror ['name' ],
108103 'port_id' : fake_tap_mirror ['port_id' ],
@@ -128,9 +123,7 @@ def test_list_tap_mirror(self):
128123 fake_tap_mirrors = list (
129124 sdk_fakes .generate_fake_resources (tap_mirror .TapMirror , count = 4 )
130125 )
131- self .app .client_manager .network .tap_mirrors .return_value = (
132- fake_tap_mirrors
133- )
126+ self .network_client .tap_mirrors .return_value = fake_tap_mirrors
134127
135128 arg_list = []
136129 verify_list = []
@@ -139,7 +132,7 @@ def test_list_tap_mirror(self):
139132
140133 headers , data = self .cmd .take_action (parsed_args )
141134
142- self .app . client_manager . network .tap_mirrors .assert_called_once ()
135+ self .network_client .tap_mirrors .assert_called_once ()
143136 self .assertEqual (headers , list (headers_long ))
144137 self .assertCountEqual (
145138 list (data ),
@@ -153,7 +146,7 @@ def test_list_tap_mirror(self):
153146class TestDeleteTapMirror (network_fakes .TestNetworkV2 ):
154147 def setUp (self ):
155148 super ().setUp ()
156- self .app . client_manager . network .find_tap_mirror .side_effect = (
149+ self .network_client .find_tap_mirror .side_effect = (
157150 lambda name_or_id , ignore_missing : tap_mirror .TapMirror (
158151 id = name_or_id
159152 )
@@ -177,8 +170,9 @@ def test_delete_tap_mirror(self):
177170 parsed_args = self .check_parser (self .cmd , arg_list , verify_list )
178171 result = self .cmd .take_action (parsed_args )
179172
180- mock_delete_tap_m = self .app .client_manager .network .delete_tap_mirror
181- mock_delete_tap_m .assert_called_once_with (fake_tap_mirror ['id' ])
173+ self .network_client .delete_tap_mirror .assert_called_once_with (
174+ fake_tap_mirror ['id' ]
175+ )
182176 self .assertIsNone (result )
183177
184178
@@ -196,7 +190,7 @@ class TestShowTapMirror(network_fakes.TestNetworkV2):
196190
197191 def setUp (self ):
198192 super ().setUp ()
199- self .app . client_manager . network .find_tap_mirror .side_effect = (
193+ self .network_client .find_tap_mirror .side_effect = (
200194 lambda name_or_id , ignore_missing : tap_mirror .TapMirror (
201195 id = name_or_id
202196 )
@@ -209,9 +203,7 @@ def test_show_tap_mirror(self):
209203 fake_tap_mirror = sdk_fakes .generate_fake_resource (
210204 tap_mirror .TapMirror
211205 )
212- self .app .client_manager .network .get_tap_mirror .return_value = (
213- fake_tap_mirror
214- )
206+ self .network_client .get_tap_mirror .return_value = fake_tap_mirror
215207 arg_list = [
216208 fake_tap_mirror ['id' ],
217209 ]
@@ -223,8 +215,9 @@ def test_show_tap_mirror(self):
223215
224216 headers , data = self .cmd .take_action (parsed_args )
225217
226- mock_get_tap_m = self .app .client_manager .network .get_tap_mirror
227- mock_get_tap_m .assert_called_once_with (fake_tap_mirror ['id' ])
218+ self .network_client .get_tap_mirror .assert_called_once_with (
219+ fake_tap_mirror ['id' ]
220+ )
228221 self .assertEqual (self .columns , headers )
229222 fake_data = _get_data (
230223 fake_tap_mirror , osc_tap_mirror ._get_columns (fake_tap_mirror )[1 ]
@@ -248,7 +241,7 @@ class TestUpdateTapMirror(network_fakes.TestNetworkV2):
248241 def setUp (self ):
249242 super ().setUp ()
250243 self .cmd = osc_tap_mirror .UpdateTapMirror (self .app , None )
251- self .app . client_manager . network .find_tap_mirror .side_effect = (
244+ self .network_client .find_tap_mirror .side_effect = (
252245 lambda name_or_id , ignore_missing : tap_mirror .TapMirror (
253246 id = name_or_id
254247 )
@@ -262,9 +255,7 @@ def test_update_tap_mirror(self):
262255 new_tap_mirror = copy .deepcopy (fake_tap_mirror )
263256 new_tap_mirror ['name' ] = self ._new_name
264257
265- self .app .client_manager .network .update_tap_mirror .return_value = (
266- new_tap_mirror
267- )
258+ self .network_client .update_tap_mirror .return_value = new_tap_mirror
268259
269260 arg_list = [
270261 fake_tap_mirror ['id' ],
@@ -277,8 +268,7 @@ def test_update_tap_mirror(self):
277268 columns , data = self .cmd .take_action (parsed_args )
278269 attrs = {'name' : self ._new_name }
279270
280- mock_update_tap_m = self .app .client_manager .network .update_tap_mirror
281- mock_update_tap_m .assert_called_once_with (
271+ self .network_client .update_tap_mirror .assert_called_once_with (
282272 fake_tap_mirror ['id' ], ** attrs
283273 )
284274 self .assertEqual (self .columns , columns )
0 commit comments