From 2cba2caa7fe0e95c09f314f588da0cfef1f7fa02 Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Wed, 29 Jun 2016 00:22:27 +0530 Subject: [PATCH] zerver/lib/test_helpers.py: Fix string annotations. --- zerver/lib/test_helpers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zerver/lib/test_helpers.py b/zerver/lib/test_helpers.py index 34f88af7eb..7c4ceaff4a 100644 --- a/zerver/lib/test_helpers.py +++ b/zerver/lib/test_helpers.py @@ -236,17 +236,17 @@ class AuthedTestCase(TestCase): # Helper because self.client.patch annoying requires you to urlencode def client_patch(self, url, info={}, **kwargs): - # type: (str, Dict[str, Any], **Any) -> HttpResponse + # type: (text_type, Dict[str, Any], **Any) -> HttpResponse encoded = urllib.parse.urlencode(info) return self.client.patch(url, encoded, **kwargs) def client_put(self, url, info={}, **kwargs): - # type: (str, Dict[str, Any], **Any) -> HttpResponse + # type: (text_type, Dict[str, Any], **Any) -> HttpResponse encoded = urllib.parse.urlencode(info) return self.client.put(url, encoded, **kwargs) def client_delete(self, url, info={}, **kwargs): - # type: (str, Dict[str, Any], **Any) -> HttpResponse + # type: (text_type, Dict[str, Any], **Any) -> HttpResponse encoded = urllib.parse.urlencode(info) return self.client.delete(url, encoded, **kwargs) @@ -311,7 +311,7 @@ class AuthedTestCase(TestCase): def send_message(self, sender_name, raw_recipients, message_type, content=u"test content", subject=u"test", **kwargs): - # type: (str, Union[text_type, List[text_type]], int, text_type, text_type, **Any) -> int + # type: (text_type, Union[text_type, List[text_type]], int, text_type, text_type, **Any) -> int sender = get_user_profile_by_email(sender_name) if message_type == Recipient.PERSONAL: message_type_name = "private" @@ -367,7 +367,7 @@ class AuthedTestCase(TestCase): return json['msg'] def assert_json_error(self, result, msg, status_code=400): - # type: (HttpResponse, str, int) -> None + # type: (HttpResponse, text_type, int) -> None """ Invalid POSTs return an error status code and JSON of the form {"result": "error", "msg": "reason"}. @@ -384,7 +384,7 @@ class AuthedTestCase(TestCase): "len(%s) == %s, > %s" % (queries, actual_count, count)) def assert_json_error_contains(self, result, msg_substring, status_code=400): - # type: (HttpResponse, str, int) -> None + # type: (HttpResponse, text_type, int) -> None self.assertIn(msg_substring, self.get_json_error(result, status_code=status_code)) def fixture_data(self, type, action, file_type='json'): @@ -405,7 +405,7 @@ class AuthedTestCase(TestCase): # Subscribe to a stream by making an API request def common_subscribe_to_streams(self, email, streams, extra_post_data={}, invite_only=False): - # type: (str, Iterable[text_type], Dict[str, Any], bool) -> HttpResponse + # type: (text_type, Iterable[text_type], Dict[str, Any], bool) -> HttpResponse post_data = {'subscriptions': ujson.dumps([{"name": stream} for stream in streams]), 'invite_only': ujson.dumps(invite_only)} post_data.update(extra_post_data)