88try :
99 import unittest2 as unittest
1010except ImportError :
11- import unittest # NOQA
11+ import unittest # NOQA
1212
1313from mock import patch , MagicMock , call
1414
@@ -118,15 +118,15 @@ def setUp(self):
118118 username = 'doesnotexist' , api_key = 'issurelywrong' ,
119119 endpoint_url = "ENDPOINT" )
120120
121- @patch ('SoftLayer.API.make_api_call ' )
122- def test_old_api (self , make_api_call ):
121+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
122+ def test_old_api (self , make_xml_rpc_api_call ):
123123 client = SoftLayer .API .Client (
124124 'SoftLayer_SERVICE' , None , 'doesnotexist' , 'issurelywrong' ,
125125 endpoint_url = "ENDPOINT" )
126126
127127 client .METHOD ()
128128
129- make_api_call .assert_called_with (
129+ make_xml_rpc_api_call .assert_called_with (
130130 'ENDPOINT/SoftLayer_SERVICE' , 'METHOD' , (),
131131 headers = {
132132 'authenticate' : {
@@ -138,8 +138,8 @@ def test_old_api(self, make_api_call):
138138 'User-Agent' : USER_AGENT ,
139139 })
140140
141- @patch ('SoftLayer.API.make_api_call ' )
142- def test_complex_old_api (self , make_api_call ):
141+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
142+ def test_complex_old_api (self , make_xml_rpc_api_call ):
143143 client = SoftLayer .API .Client (
144144 'SoftLayer_SERVICE' , None , 'doesnotexist' , 'issurelywrong' ,
145145 endpoint_url = "ENDPOINT" )
@@ -156,7 +156,7 @@ def test_complex_old_api(self, make_api_call):
156156 'TYPE' : {'obj' : {'attribute' : {'operation' : '^= prefix' }}}},
157157 limit = 9 , offset = 10 )
158158
159- make_api_call .assert_called_with (
159+ make_xml_rpc_api_call .assert_called_with (
160160 'ENDPOINT/SoftLayer_SERVICE' , 'METHOD' , (1234 , ),
161161 headers = {
162162 'SoftLayer_SERVICEObjectMask' : {
@@ -181,10 +181,10 @@ def test_old_api_no_service(self):
181181 api_key = 'issurelywrong' )
182182 self .assertRaises (SoftLayer .SoftLayerError , client .METHOD )
183183
184- @patch ('SoftLayer.API.make_api_call ' )
185- def test_simple_call (self , make_api_call ):
184+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
185+ def test_simple_call (self , make_xml_rpc_api_call ):
186186 self .client ['SERVICE' ].METHOD ()
187- make_api_call .assert_called_with (
187+ make_xml_rpc_api_call .assert_called_with (
188188 'ENDPOINT/SoftLayer_SERVICE' , 'METHOD' , (),
189189 headers = {
190190 'authenticate' : {
@@ -196,8 +196,8 @@ def test_simple_call(self, make_api_call):
196196 'User-Agent' : USER_AGENT ,
197197 })
198198
199- @patch ('SoftLayer.API.make_api_call ' )
200- def test_complex (self , make_api_call ):
199+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
200+ def test_complex (self , make_xml_rpc_api_call ):
201201 self .client ['SERVICE' ].METHOD (
202202 1234 ,
203203 id = 5678 ,
@@ -207,7 +207,7 @@ def test_complex(self, make_api_call):
207207 'TYPE' : {'obj' : {'attribute' : {'operation' : '^= prefix' }}}},
208208 limit = 9 , offset = 10 )
209209
210- make_api_call .assert_called_with (
210+ make_xml_rpc_api_call .assert_called_with (
211211 'ENDPOINT/SoftLayer_SERVICE' , 'METHOD' , (1234 , ),
212212 headers = {
213213 'SoftLayer_SERVICEObjectMask' : {
@@ -227,11 +227,11 @@ def test_complex(self, make_api_call):
227227 'User-Agent' : USER_AGENT ,
228228 })
229229
230- @patch ('SoftLayer.API.make_api_call ' )
231- def test_mask_call_v2 (self , make_api_call ):
230+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
231+ def test_mask_call_v2 (self , make_xml_rpc_api_call ):
232232 self .client ['SERVICE' ].METHOD (
233233 mask = "mask[something[nested]]" )
234- make_api_call .assert_called_with (
234+ make_xml_rpc_api_call .assert_called_with (
235235 'ENDPOINT/SoftLayer_SERVICE' , 'METHOD' , (),
236236 headers = {
237237 'authenticate' : {
@@ -244,11 +244,11 @@ def test_mask_call_v2(self, make_api_call):
244244 'User-Agent' : USER_AGENT ,
245245 })
246246
247- @patch ('SoftLayer.API.make_api_call ' )
248- def test_mask_call_v2_dot (self , make_api_call ):
247+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
248+ def test_mask_call_v2_dot (self , make_xml_rpc_api_call ):
249249 self .client ['SERVICE' ].METHOD (
250250 mask = "mask.something.nested" )
251- make_api_call .assert_called_with (
251+ make_xml_rpc_api_call .assert_called_with (
252252 'ENDPOINT/SoftLayer_SERVICE' , 'METHOD' , (),
253253 headers = {
254254 'authenticate' : {
@@ -261,8 +261,8 @@ def test_mask_call_v2_dot(self, make_api_call):
261261 'User-Agent' : USER_AGENT ,
262262 })
263263
264- @patch ('SoftLayer.API.make_api_call ' )
265- def test_mask_call_invalid_mask (self , make_api_call ):
264+ @patch ('SoftLayer.API.make_xml_rpc_api_call ' )
265+ def test_mask_call_invalid_mask (self , make_xml_rpc_api_call ):
266266 try :
267267 self .client ['SERVICE' ].METHOD (mask = "mask[something.nested" )
268268 except SoftLayer .SoftLayerError , e :
0 commit comments