Merge pull request #732 from constantinblanariu/python-2.7-fixes

Minor Python 2.7 fixes
This commit is contained in:
Ross McFarland
2021-06-25 15:49:33 -07:00
committed by GitHub
3 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -261,7 +261,8 @@ class Manager(object):
try:
source.populate(zone, lenient=lenient)
except TypeError as e:
if "keyword argument 'lenient'" not in text_type(e):
if ("unexpected keyword argument 'lenient'"
not in text_type(e)):
raise
self.log.warn('provider %s does not accept lenient '
'param', source.__class__.__name__)
+5 -1
View File
@@ -1,8 +1,11 @@
from __future__ import unicode_literals
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 unittest import TestCase
from json import load as json_load
@@ -55,7 +58,8 @@ class TestUltraProvider(TestCase):
self.assertEquals(1, mock.call_count)
expected_payload = "grant_type=password&username=user&"\
"password=rightpass"
self.assertEquals(mock.last_request.text, expected_payload)
self.assertEquals(parse.parse_qs(mock.last_request.text),
parse.parse_qs(expected_payload))
def test_get_zones(self):
provider = _get_provider()
+1 -1
View File
@@ -1,6 +1,6 @@
from mock import patch
from six import text_type
from unittest import TestCase
from unittest.mock import patch
from octodns.source.envvar import EnvVarSource
from octodns.source.envvar import EnvironmentVariableNotFoundException