@@ -66,9 +66,9 @@ def setUp(self):
66
66
def test_init (self , mock_identity_get ):
67
67
mock_identity_get .return_value = create_identity ('1234' )
68
68
a = mycroft .api .Api ('test-path' )
69
- self .assertEquals (a .url , 'https://api-test.mycroft.ai' )
70
- self .assertEquals (a .version , 'v1' )
71
- self .assertEquals (a .identity .uuid , '1234' )
69
+ self .assertEqual (a .url , 'https://api-test.mycroft.ai' )
70
+ self .assertEqual (a .version , 'v1' )
71
+ self .assertEqual (a .identity .uuid , '1234' )
72
72
73
73
@patch ('mycroft.api.IdentityManager' )
74
74
@patch ('mycroft.api.requests.request' )
@@ -84,7 +84,7 @@ def test_send(self, mock_request, mock_identity_manager):
84
84
req = {'path' : 'something' , 'headers' : {}}
85
85
86
86
# Check successful
87
- self .assertEquals (a .send (req ), mock_response_ok .json ())
87
+ self .assertEqual (a .send (req ), mock_response_ok .json ())
88
88
89
89
# check that a 300+ status code generates Exception
90
90
mock_request .return_value = mock_response_301
@@ -121,8 +121,8 @@ def test_init(self, mock_request, mock_identity_get):
121
121
mock_identity_get .return_value = create_identity ('1234' )
122
122
123
123
device = mycroft .api .DeviceApi ()
124
- self .assertEquals (device .identity .uuid , '1234' )
125
- self .assertEquals (device .path , 'device' )
124
+ self .assertEqual (device .identity .uuid , '1234' )
125
+ self .assertEqual (device .path , 'device' )
126
126
127
127
@patch ('mycroft.api.IdentityManager.get' )
128
128
@patch ('mycroft.api.requests.request' )
@@ -133,8 +133,8 @@ def test_device_activate(self, mock_request, mock_identity_get):
133
133
device = mycroft .api .DeviceApi ()
134
134
device .activate ('state' , 'token' )
135
135
json = mock_request .call_args [1 ]['json' ]
136
- self .assertEquals (json ['state' ], 'state' )
137
- self .assertEquals (json ['token' ], 'token' )
136
+ self .assertEqual (json ['state' ], 'state' )
137
+ self .assertEqual (json ['token' ], 'token' )
138
138
139
139
@patch ('mycroft.api.IdentityManager.get' )
140
140
@patch ('mycroft.api.requests.request' )
@@ -145,7 +145,7 @@ def test_device_get(self, mock_request, mock_identity_get):
145
145
device = mycroft .api .DeviceApi ()
146
146
device .get ()
147
147
url = mock_request .call_args [0 ][1 ]
148
- self .assertEquals (url , 'https://api-test.mycroft.ai/v1/device/1234' )
148
+ self .assertEqual (url , 'https://api-test.mycroft.ai/v1/device/1234' )
149
149
150
150
@patch ('mycroft.api.IdentityManager.update' )
151
151
@patch ('mycroft.api.IdentityManager.get' )
@@ -156,9 +156,9 @@ def test_device_get_code(self, mock_request, mock_identity_get,
156
156
mock_identity_get .return_value = create_identity ('1234' )
157
157
device = mycroft .api .DeviceApi ()
158
158
ret = device .get_code ('state' )
159
- self .assertEquals (ret , '123ABC' )
159
+ self .assertEqual (ret , '123ABC' )
160
160
url = mock_request .call_args [0 ][1 ]
161
- self .assertEquals (
161
+ self .assertEqual (
162
162
url , 'https://api-test.mycroft.ai/v1/device/code?state=state' )
163
163
164
164
@patch ('mycroft.api.IdentityManager.get' )
@@ -169,7 +169,7 @@ def test_device_get_settings(self, mock_request, mock_identity_get):
169
169
device = mycroft .api .DeviceApi ()
170
170
device .get_settings ()
171
171
url = mock_request .call_args [0 ][1 ]
172
- self .assertEquals (
172
+ self .assertEqual (
173
173
url , 'https://api-test.mycroft.ai/v1/device/1234/setting' )
174
174
175
175
@patch ('mycroft.api.IdentityManager.get' )
@@ -184,9 +184,9 @@ def test_device_report_metric(self, mock_request, mock_identity_get):
184
184
185
185
content_type = params ['headers' ]['Content-Type' ]
186
186
correct_json = {'data' : 'mydata' }
187
- self .assertEquals (content_type , 'application/json' )
188
- self .assertEquals (params ['json' ], correct_json )
189
- self .assertEquals (
187
+ self .assertEqual (content_type , 'application/json' )
188
+ self .assertEqual (params ['json' ], correct_json )
189
+ self .assertEqual (
190
190
url , 'https://api-test.mycroft.ai/v1/device/1234/metric/mymetric' )
191
191
192
192
@patch ('mycroft.api.IdentityManager.get' )
@@ -201,9 +201,9 @@ def test_device_send_email(self, mock_request, mock_identity_get):
201
201
202
202
content_type = params ['headers' ]['Content-Type' ]
203
203
correct_json = {'body' : 'body' , 'sender' : 'sender' , 'title' : 'title' }
204
- self .assertEquals (content_type , 'application/json' )
205
- self .assertEquals (params ['json' ], correct_json )
206
- self .assertEquals (
204
+ self .assertEqual (content_type , 'application/json' )
205
+ self .assertEqual (params ['json' ], correct_json )
206
+ self .assertEqual (
207
207
url , 'https://api-test.mycroft.ai/v1/device/1234/message' )
208
208
209
209
@patch ('mycroft.api.IdentityManager.get' )
@@ -215,7 +215,7 @@ def test_device_get_oauth_token(self, mock_request, mock_identity_get):
215
215
device .get_oauth_token (1 )
216
216
url = mock_request .call_args [0 ][1 ]
217
217
218
- self .assertEquals (
218
+ self .assertEqual (
219
219
url , 'https://api-test.mycroft.ai/v1/device/1234/token/1' )
220
220
221
221
@patch ('mycroft.api.IdentityManager.get' )
@@ -226,7 +226,7 @@ def test_device_get_location(self, mock_request, mock_identity_get):
226
226
device = mycroft .api .DeviceApi ()
227
227
device .get_location ()
228
228
url = mock_request .call_args [0 ][1 ]
229
- self .assertEquals (
229
+ self .assertEqual (
230
230
url , 'https://api-test.mycroft.ai/v1/device/1234/location' )
231
231
232
232
@patch ('mycroft.api.IdentityManager.get' )
@@ -237,7 +237,7 @@ def test_device_get_subscription(self, mock_request, mock_identity_get):
237
237
device = mycroft .api .DeviceApi ()
238
238
device .get_subscription ()
239
239
url = mock_request .call_args [0 ][1 ]
240
- self .assertEquals (
240
+ self .assertEqual (
241
241
url , 'https://api-test.mycroft.ai/v1/device/1234/subscription' )
242
242
243
243
mock_request .return_value = create_response (200 , {'@type' : 'free' })
@@ -260,7 +260,7 @@ def test_device_upload_skills_data(self, mock_request, mock_identity_get):
260
260
data = mock_request .call_args [1 ]['json' ]
261
261
262
262
# Check that the correct url is called
263
- self .assertEquals (
263
+ self .assertEqual (
264
264
url , 'https://api-test.mycroft.ai/v1/device/1234/skillJson' )
265
265
266
266
# Check that the correct data is sent as json
@@ -276,7 +276,7 @@ def test_stt(self, mock_request, mock_identity_get):
276
276
mock_request .return_value = create_response (200 , {})
277
277
mock_identity_get .return_value = create_identity ('1234' )
278
278
stt = mycroft .api .STTApi ('stt' )
279
- self .assertEquals (stt .path , 'stt' )
279
+ self .assertEqual (stt .path , 'stt' )
280
280
281
281
@patch ('mycroft.api.IdentityManager.get' )
282
282
@patch ('mycroft.api.requests.request' )
@@ -286,11 +286,11 @@ def test_stt_stt(self, mock_request, mock_identity_get):
286
286
stt = mycroft .api .STTApi ('stt' )
287
287
stt .stt ('La la la' , 'en-US' , 1 )
288
288
url = mock_request .call_args [0 ][1 ]
289
- self .assertEquals (url , 'https://api-test.mycroft.ai/v1/stt' )
289
+ self .assertEqual (url , 'https://api-test.mycroft.ai/v1/stt' )
290
290
data = mock_request .call_args [1 ].get ('data' )
291
- self .assertEquals (data , 'La la la' )
291
+ self .assertEqual (data , 'La la la' )
292
292
params = mock_request .call_args [1 ].get ('params' )
293
- self .assertEquals (params ['lang' ], 'en-US' )
293
+ self .assertEqual (params ['lang' ], 'en-US' )
294
294
295
295
@patch ('mycroft.api.IdentityManager.load' )
296
296
def test_has_been_paired (self , mock_identity_load ):
@@ -347,10 +347,10 @@ def test_upload_meta(self, mock_request, mock_identity_get):
347
347
params = mock_request .call_args [1 ]
348
348
349
349
content_type = params ['headers' ]['Content-Type' ]
350
- self .assertEquals (content_type , 'application/json' )
351
- self .assertEquals (method , 'PUT' )
352
- self .assertEquals (params ['json' ], settings_meta )
353
- self .assertEquals (
350
+ self .assertEqual (content_type , 'application/json' )
351
+ self .assertEqual (method , 'PUT' )
352
+ self .assertEqual (params ['json' ], settings_meta )
353
+ self .assertEqual (
354
354
url , 'https://api-test.mycroft.ai/v1/device/1234/settingsMeta' )
355
355
356
356
def test_get_skill_settings (self , mock_request , mock_identity_get ):
@@ -362,8 +362,8 @@ def test_get_skill_settings(self, mock_request, mock_identity_get):
362
362
url = mock_request .call_args [0 ][1 ]
363
363
params = mock_request .call_args [1 ]
364
364
365
- self .assertEquals (method , 'GET' )
366
- self .assertEquals (
365
+ self .assertEqual (method , 'GET' )
366
+ self .assertEqual (
367
367
url , 'https://api-test.mycroft.ai/v1/device/1234/skill/settings' )
368
368
369
369
@@ -389,9 +389,9 @@ def test_is_paired_true(self, mock_request, mock_identity_get):
389
389
390
390
self .assertTrue (mycroft .api .is_paired ())
391
391
392
- self .assertEquals (num_calls , mock_identity_get .num_calls )
392
+ self .assertEqual (num_calls , mock_identity_get .num_calls )
393
393
url = mock_request .call_args [0 ][1 ]
394
- self .assertEquals (url , 'https://api-test.mycroft.ai/v1/device/1234' )
394
+ self .assertEqual (url , 'https://api-test.mycroft.ai/v1/device/1234' )
395
395
396
396
def test_is_paired_false_local (self , mock_request , mock_identity_get ):
397
397
mock_request .return_value = create_response (200 )
0 commit comments