zerver/tests: Remove `import six`.

This commit is contained in:
rht 2017-09-27 10:11:59 +02:00 committed by Tim Abbott
parent a7803cbf1b
commit daef6a7dbc
3 changed files with 9 additions and 12 deletions

View File

@ -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,))

View File

@ -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))

View File

@ -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):