From daef6a7dbc98cf93ed4678094064af0312d45ddb Mon Sep 17 00:00:00 2001 From: rht Date: Wed, 27 Sep 2017 10:11:59 +0200 Subject: [PATCH] zerver/tests: Remove `import six`. --- zerver/tests/test_bugdown.py | 3 +-- zerver/tests/test_subs.py | 9 ++++----- zerver/tests/test_urls.py | 9 ++++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/zerver/tests/test_bugdown.py b/zerver/tests/test_bugdown.py index ed79a5d117..2e0f734efa 100644 --- a/zerver/tests/test_bugdown.py +++ b/zerver/tests/test_bugdown.py @@ -40,7 +40,6 @@ import copy import mock import os import ujson -import six from six.moves import urllib from zerver.lib.str_utils import NonBinaryStr @@ -182,7 +181,7 @@ class BugdownTest(ZulipTestCase): # type: () -> None format_tests, linkify_tests = self.load_bugdown_tests() - for name, test in six.iteritems(format_tests): + for name, test in format_tests.items(): converted = bugdown_convert(test['input']) print("Running Bugdown test %s" % (name,)) diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py index 205804d9d7..701567263d 100644 --- a/zerver/tests/test_subs.py +++ b/zerver/tests/test_subs.py @@ -57,7 +57,6 @@ from django.http import HttpResponse import mock import random import ujson -import six from six.moves import range, urllib, zip class TestCreateStreams(ZulipTestCase): @@ -1319,8 +1318,8 @@ class SubscriptionAPITest(ZulipTestCase): json = result.json() self.assertIn("subscriptions", json) for stream in json['subscriptions']: - self.assertIsInstance(stream['name'], six.string_types) - self.assertIsInstance(stream['color'], six.string_types) + self.assertIsInstance(stream['name'], str) + self.assertIsInstance(stream['color'], str) self.assertIsInstance(stream['invite_only'], bool) # check that the stream name corresponds to an actual # stream; will throw Stream.DoesNotExist if it doesn't @@ -1971,7 +1970,7 @@ class SubscriptionAPITest(ZulipTestCase): {"subscriptions": ujson.dumps(subscriptions)}) self.assert_json_success(result) json = result.json() - for key, val in six.iteritems(json_dict): + for key, val in json_dict.items(): self.assertEqual(sorted(val), sorted(json[key])) # we don't care about the order of the items new_streams = self.get_streams(email, realm) self.assertEqual(sorted(new_streams), sorted(new_subs)) @@ -2646,7 +2645,7 @@ class GetSubscribersTest(ZulipTestCase): self.assertIsInstance(result_dict['subscribers'], list) subscribers = [] # type: List[Text] for subscriber in result_dict['subscribers']: - self.assertIsInstance(subscriber, six.string_types) + self.assertIsInstance(subscriber, str) subscribers.append(subscriber) self.assertEqual(set(subscribers), set(expected_subscribers)) diff --git a/zerver/tests/test_urls.py b/zerver/tests/test_urls.py index 9a4a484f8f..03a7b4ba92 100644 --- a/zerver/tests/test_urls.py +++ b/zerver/tests/test_urls.py @@ -3,7 +3,6 @@ from __future__ import print_function import importlib import os -import six import ujson import django.core.urlresolvers @@ -80,13 +79,13 @@ class PublicURLTest(ZulipTestCase): } put_urls = {401: ["/json/users/me/pointer"], } - for status_code, url_set in six.iteritems(get_urls): + for status_code, url_set in get_urls.items(): self.fetch("client_get", url_set, status_code) - for status_code, url_set in six.iteritems(post_urls): + for status_code, url_set in post_urls.items(): self.fetch("client_post", url_set, status_code) - for status_code, url_set in six.iteritems(patch_urls): + for status_code, url_set in patch_urls.items(): self.fetch("client_patch", url_set, status_code) - for status_code, url_set in six.iteritems(put_urls): + for status_code, url_set in put_urls.items(): self.fetch("client_put", url_set, status_code) def test_get_gcid_when_not_configured(self):