@@ -151,7 +151,7 @@ def test_get_profile_success(self, mock_requests, mock_authenticate):
151151 self .assertIsNotNone (api ._cookies )
152152 self .assertEqual (api ._cookies , self .cookie_jar )
153153 self .assertEqual (response .get ("code" ), 200 )
154- self .assertDictEqual (response .get ("profile " ), expected_response )
154+ self .assertDictEqual (response .get ("data " ), expected_response )
155155
156156 @patch ("loading_sdk.api.requests" )
157157 def test_get_profile_failure (self , mock_requests ):
@@ -209,7 +209,7 @@ def test_search_success(self, mock_requests):
209209 response = api .search ("zGwszApFEcY" )
210210
211211 self .assertEqual (response .get ("code" ), 200 )
212- self .assertEqual (response .get ("search_results " ), expected_response )
212+ self .assertEqual (response .get ("data " ), expected_response )
213213
214214 @patch ("loading_sdk.api.requests" )
215215 def test_search_success_no_results (self , mock_requests ):
@@ -224,7 +224,7 @@ def test_search_success_no_results(self, mock_requests):
224224 response = api .search ("zGwszApFEcYesf" )
225225
226226 self .assertEqual (response .get ("code" ), 200 )
227- self .assertEqual (response .get ("search_results " ), expected_response )
227+ self .assertEqual (response .get ("data " ), expected_response )
228228
229229 @patch ("loading_sdk.api.requests" )
230230 def test_search_failure_empty_query (self , mock_requests ):
@@ -327,7 +327,7 @@ def test_get_post_success(self, mock_requests):
327327 response = api .get_post ("none_existing_post_id" )
328328
329329 self .assertEqual (response .get ("code" ), 200 )
330- self .assertEqual (response .get ("post " ), expected_response )
330+ self .assertEqual (response .get ("data " ), expected_response )
331331
332332 @patch ("loading_sdk.api.requests" )
333333 def test_get_thread_success (self , mock_requests ):
@@ -369,19 +369,19 @@ def test_get_thread_success(self, mock_requests):
369369 response = api .get_thread ("5f9e4e8c2c32e2001ed17170" )
370370
371371 self .assertEqual (response .get ("code" ), 200 )
372- self .assertEqual (response .get ("post " ), expected_response )
372+ self .assertEqual (response .get ("data " ), expected_response )
373373
374374 api = LoadingApiClient ()
375375 response = api .get_thread ("5f9e4e8c2c32e2001ed17170" , page = 0 )
376376
377377 self .assertEqual (response .get ("code" ), 200 )
378- self .assertEqual (response .get ("post " ), expected_response )
378+ self .assertEqual (response .get ("data " ), expected_response )
379379
380380 api = LoadingApiClient ()
381381 response = api .get_thread ("5f9e4e8c2c32e2001ed17170" , page = 1 )
382382
383383 self .assertEqual (response .get ("code" ), 200 )
384- self .assertEqual (response .get ("post " ), expected_response )
384+ self .assertEqual (response .get ("data " ), expected_response )
385385
386386 @patch ("loading_sdk.api.requests" )
387387 def test_get_thread_failure_empty_thread_id (self , mock_requests ):
@@ -464,7 +464,7 @@ def test_get_thread_failure_does_not_exist(self, mock_requests):
464464 @patch ("loading_sdk.api.requests" )
465465 def test_get_thread_failure_page_too_low (self , mock_requests ):
466466 status_code = 200
467- expected_response = {"code" : 200 , "post " : {"posts" : [], "users" : []}}
467+ expected_response = {"code" : 200 , "data " : {"posts" : [], "users" : []}}
468468
469469 mock_response = MagicMock ()
470470 mock_response .status_code = status_code
@@ -506,7 +506,7 @@ def test_get_thread_failure_page_too_low(self, mock_requests):
506506 @patch ("loading_sdk.api.requests" )
507507 def test_get_thread_failure_page_too_high (self , mock_requests ):
508508 status_code = 200
509- expected_response = {"code" : 200 , "post " : {"posts" : [], "users" : []}}
509+ expected_response = {"code" : 200 , "data " : {"posts" : [], "users" : []}}
510510
511511 mock_response = MagicMock ()
512512 mock_response .status_code = status_code
@@ -927,12 +927,12 @@ def test_get_games_success(self, mock_requests):
927927 api = LoadingApiClient ()
928928 response = api .get_games (page = 91 )
929929
930- self .assertDictEqual (response .get ("post " ), expected_response )
930+ self .assertDictEqual (response .get ("data " ), expected_response )
931931
932932 @patch ("loading_sdk.api.requests" )
933933 def test_get_games_failure_page_too_low (self , mock_requests ):
934934 status_code = 404
935- expected_response = {"code" : status_code , "post " : {"posts" : [], "users" : []}}
935+ expected_response = {"code" : status_code , "data " : {"posts" : [], "users" : []}}
936936
937937 mock_response = MagicMock ()
938938 mock_response .status_code = status_code
@@ -947,7 +947,7 @@ def test_get_games_failure_page_too_low(self, mock_requests):
947947 @patch ("loading_sdk.api.requests" )
948948 def test_get_games_failure_page_too_high (self , mock_requests ):
949949 status_code = 404
950- expected_response = {"code" : status_code , "post " : {"posts" : [], "users" : []}}
950+ expected_response = {"code" : status_code , "data " : {"posts" : [], "users" : []}}
951951
952952 mock_response = MagicMock ()
953953 mock_response .status_code = status_code
@@ -1170,17 +1170,17 @@ def test_get_other_success(self, mock_requests):
11701170 api = LoadingApiClient ()
11711171 response = api .get_games (page = 91 )
11721172
1173- self .assertDictEqual (response .get ("post " ), expected_response )
1173+ self .assertDictEqual (response .get ("data " ), expected_response )
11741174
1175- threads = response .get ("post " ).get ("posts" )
1175+ threads = response .get ("data " ).get ("posts" )
11761176
11771177 for thread in threads :
11781178 self .assertEqual (thread .get ("category" ), "other" )
11791179
11801180 @patch ("loading_sdk.api.requests" )
11811181 def test_get_other_failure_page_too_low (self , mock_requests ):
11821182 status_code = 404
1183- expected_response = {"code" : status_code , "post " : {"posts" : [], "users" : []}}
1183+ expected_response = {"code" : status_code , "data " : {"posts" : [], "users" : []}}
11841184
11851185 mock_response = MagicMock ()
11861186 mock_response .status_code = status_code
@@ -1195,7 +1195,7 @@ def test_get_other_failure_page_too_low(self, mock_requests):
11951195 @patch ("loading_sdk.api.requests" )
11961196 def test_get_other_failure_page_too_high (self , mock_requests ):
11971197 status_code = 404
1198- expected_response = {"code" : status_code , "post " : {"posts" : [], "users" : []}}
1198+ expected_response = {"code" : status_code , "data " : {"posts" : [], "users" : []}}
11991199
12001200 mock_response = MagicMock ()
12011201 mock_response .status_code = status_code
@@ -1505,17 +1505,17 @@ def test_get_editorials_success(self, mock_requests):
15051505 api = LoadingApiClient ()
15061506 response = api .get_editorials (page = 1 , post_type = "update" , sort = "title" )
15071507
1508- self .assertDictEqual (response .get ("post " ), expected_response )
1508+ self .assertDictEqual (response .get ("data " ), expected_response )
15091509
1510- threads = response .get ("post " ).get ("posts" )
1510+ threads = response .get ("data " ).get ("posts" )
15111511
15121512 for thread in threads :
15131513 self .assertEqual (thread .get ("postType" ), "update" )
15141514
15151515 @patch ("loading_sdk.api.requests" )
15161516 def test_get_editorials_failure_page_too_low (self , mock_requests ):
15171517 status_code = 404
1518- expected_response = {"code" : status_code , "post " : {"posts" : [], "users" : []}}
1518+ expected_response = {"code" : status_code , "data " : {"posts" : [], "users" : []}}
15191519
15201520 mock_response = MagicMock ()
15211521 mock_response .status_code = status_code
@@ -1534,7 +1534,7 @@ def test_get_editorials_failure_page_too_low(self, mock_requests):
15341534 @patch ("loading_sdk.api.requests" )
15351535 def test_get_editorials_failure_page_too_high (self , mock_requests ):
15361536 status_code = 404
1537- expected_response = {"code" : status_code , "post " : {"posts" : [], "users" : []}}
1537+ expected_response = {"code" : status_code , "data " : {"posts" : [], "users" : []}}
15381538
15391539 mock_response = MagicMock ()
15401540 mock_response .status_code = status_code
0 commit comments