aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-10-11 23:59:24 +0200
committerLorenz Diener <[email protected]>2019-10-11 23:59:24 +0200
commit437f68c29a18303de3c75962021bbe030b2cf85c (patch)
tree83b7ba151a3e52163fd7048f82672394bcbb3865 /mastodon
parent2c2f55fd63e4096580f4d56279c261cedb1be1a9 (diff)
downloadmastodon.py-437f68c29a18303de3c75962021bbe030b2cf85c.tar.gz
Update tests for 3.0.1 and fix regressions
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 7f9a008..2a9833b 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -1812,7 +1812,7 @@ class Mastodon:
1812 1812
1813 if self.verify_minimum_version("2.9.2"): 1813 if self.verify_minimum_version("2.9.2"):
1814 url = '/api/v1/notifications/{0}/dismiss'.format(str(id)) 1814 url = '/api/v1/notifications/{0}/dismiss'.format(str(id))
1815 return self.__api_request('POST', '/api/v1/notifications/dismiss', params) 1815 self.__api_request('POST', url)
1816 else: 1816 else:
1817 params = self.__generate_params(locals()) 1817 params = self.__generate_params(locals())
1818 self.__api_request('POST', '/api/v1/notifications/dismiss', params) 1818 self.__api_request('POST', '/api/v1/notifications/dismiss', params)
@@ -2307,7 +2307,10 @@ class Mastodon:
2307 2307
2308 if mention_events != None: 2308 if mention_events != None:
2309 params['data[alerts][mention]'] = mention_events 2309 params['data[alerts][mention]'] = mention_events
2310 2310
2311 # Canonicalize booleans
2312 params = self.__generate_params(params)
2313
2311 return self.__api_request('POST', '/api/v1/push/subscription', params) 2314 return self.__api_request('POST', '/api/v1/push/subscription', params)
2312 2315
2313 @api_version("2.4.0", "2.4.0", __DICT_VERSION_PUSH) 2316 @api_version("2.4.0", "2.4.0", __DICT_VERSION_PUSH)
@@ -2333,6 +2336,9 @@ class Mastodon:
2333 if mention_events != None: 2336 if mention_events != None:
2334 params['data[alerts][mention]'] = mention_events 2337 params['data[alerts][mention]'] = mention_events
2335 2338
2339 # Canonicalize booleans
2340 params = self.__generate_params(params)
2341
2336 return self.__api_request('PUT', '/api/v1/push/subscription', params) 2342 return self.__api_request('PUT', '/api/v1/push/subscription', params)
2337 2343
2338 @api_version("2.4.0", "2.4.0", "2.4.0") 2344 @api_version("2.4.0", "2.4.0", "2.4.0")
@@ -2862,9 +2868,9 @@ class Mastodon:
2862 """ 2868 """
2863 for key in ('follow', 'favourite', 'reblog', 'mention'): 2869 for key in ('follow', 'favourite', 'reblog', 'mention'):
2864 if (key in json_object and isinstance(json_object[key], six.text_type)): 2870 if (key in json_object and isinstance(json_object[key], six.text_type)):
2865 if json_object[key] == 'True': 2871 if json_object[key].lower() == 'true':
2866 json_object[key] = True 2872 json_object[key] = True
2867 if json_object[key] == 'False': 2873 if json_object[key].lower() == 'False':
2868 json_object[key] = False 2874 json_object[key] = False
2869 return json_object 2875 return json_object
2870 2876
@@ -3270,7 +3276,9 @@ class Mastodon:
3270 """ 3276 """
3271 params = collections.OrderedDict(params) 3277 params = collections.OrderedDict(params)
3272 3278
3273 del params['self'] 3279 if 'self' in params:
3280 del params['self']
3281
3274 param_keys = list(params.keys()) 3282 param_keys = list(params.keys())
3275 for key in param_keys: 3283 for key in param_keys:
3276 if isinstance(params[key], bool) and params[key] == False: 3284 if isinstance(params[key], bool) and params[key] == False:
Powered by cgit v1.2.3 (git 2.41.0)