mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Remove explicit use of six
This commit is contained in:
@@ -4,8 +4,7 @@ from mock import Mock, call
|
||||
from os.path import dirname, join
|
||||
from requests import HTTPError
|
||||
from requests_mock import ANY, mock as requests_mock
|
||||
from six import text_type
|
||||
from six.moves.urllib import parse
|
||||
from urllib.parse import parse_qs
|
||||
from unittest import TestCase
|
||||
from json import load as json_load
|
||||
|
||||
@@ -45,7 +44,7 @@ class TestUltraProvider(TestCase):
|
||||
text='{"errorCode": 60001}')
|
||||
with self.assertRaises(Exception) as ctx:
|
||||
UltraProvider('test', 'account', 'user', 'wrongpass')
|
||||
self.assertEquals('Unauthorized', text_type(ctx.exception))
|
||||
self.assertEquals('Unauthorized', str(ctx.exception))
|
||||
|
||||
# Good Auth
|
||||
with requests_mock() as mock:
|
||||
@@ -58,8 +57,8 @@ class TestUltraProvider(TestCase):
|
||||
self.assertEquals(1, mock.call_count)
|
||||
expected_payload = "grant_type=password&username=user&"\
|
||||
"password=rightpass"
|
||||
self.assertEquals(parse.parse_qs(mock.last_request.text),
|
||||
parse.parse_qs(expected_payload))
|
||||
self.assertEquals(parse_qs(mock.last_request.text),
|
||||
parse_qs(expected_payload))
|
||||
|
||||
def test_get_zones(self):
|
||||
provider = _get_provider()
|
||||
@@ -145,7 +144,7 @@ class TestUltraProvider(TestCase):
|
||||
headers={'Authorization': 'Bearer 123'}, json={})
|
||||
with self.assertRaises(Exception) as ctx:
|
||||
provider._get(path)
|
||||
self.assertEquals('Unauthorized', text_type(ctx.exception))
|
||||
self.assertEquals('Unauthorized', str(ctx.exception))
|
||||
|
||||
# Test all GET patterns
|
||||
with requests_mock() as mock:
|
||||
|
||||
Reference in New Issue
Block a user