fix tests and test requirements

Changes to python-whois require updates to dns unittests.

Updates pep8 requirement from jcrocholl/pep8 Issue#240:
    Fix was merged into pep8 1.5.7
Updates hacking requirement to fix VersionConflict

Change-Id: I44deeb5f7b164f6a40d4eabc68630f373ea2167a
Implements: blueprint dependency-fix
Closes-Bug: #1347093
This commit is contained in:
Samuel Stavinoha 2014-07-22 18:51:37 +00:00
parent dca1d8d28a
commit e7aee8a7cd
4 changed files with 12 additions and 14 deletions

View File

@ -116,7 +116,7 @@ def parse(template, extra_globals=None, env_vars=None, **kwargs):
try:
result = template.render(**minimum_kwargs)
#TODO(zns): exceptions in Jinja template sometimes missing traceback
# TODO(zns): exceptions in Jinja template sometimes missing traceback
except jinja2.TemplateError as exc:
LOG.error(exc, exc_info=True)
error_message = "Template had an error: %s" % exc

View File

@ -55,7 +55,7 @@ def run(target, config=None, interactive=False):
hostname = dns.parse_target_hostname(target)
found['hostname'] = hostname
ip_address = six.text_type(dns.resolve_hostname(hostname))
#TODO(sam): Use ipaddress.ip_address.is_global
# TODO(sam): Use ipaddress.ip_address.is_global
# " .is_private
# " .is_unspecified
# " .is_multicast

View File

@ -120,7 +120,7 @@ class TestDNS(utils.TestCase):
patcher = mock.patch.object(pythonwhois.net, 'get_whois_raw')
self.mock_get_whois_raw = patcher.start()
self.mock_get_whois_raw.return_value = self.WHOIS
self.mock_get_whois_raw.return_value = self.WHOIS, [None]
self.addCleanup(patcher.stop)
super(TestDNS, self).setUp()
@ -187,7 +187,7 @@ class TestDNS(utils.TestCase):
NS 1 : dns1.example.com
NS 2 : dns2.example.com
"""]
self.mock_get_whois_raw.return_value = small_whois
self.mock_get_whois_raw.return_value = small_whois, [None]
data = dns.domain_info(self.domain)
self.assertEqual(
[],
@ -224,7 +224,7 @@ class TestDNS(utils.TestCase):
NS 1 : dns1.example.com
NS 2 : dns2.example.com
"""]
self.mock_get_whois_raw.return_value = small_whois
self.mock_get_whois_raw.return_value = small_whois, [None]
data = dns.domain_info(self.domain)
self.assertEqual(
data['days_until_expires'],
@ -244,7 +244,7 @@ class TestDNS(utils.TestCase):
NS 1 : dns1.example.com
NS 2 : dns2.example.com
"""]
self.mock_get_whois_raw.return_value = small_whois
self.mock_get_whois_raw.return_value = small_whois, [None]
data = dns.domain_info(self.domain)
self.assertIsInstance(data['expiration_date'], six.string_types)
@ -260,7 +260,7 @@ class TestDNS(utils.TestCase):
NS 1 : dns1.example.com
NS 2 : dns2.example.com
"""]
self.mock_get_whois_raw.return_value = small_whois
self.mock_get_whois_raw.return_value = small_whois, [None]
data = dns.domain_info(self.domain)
self.assertIsNone(data['expiration_date'])
@ -269,7 +269,7 @@ class TestDNS(utils.TestCase):
Home net HOME-NET-192-168 (NET-192-0-0-0-1)
Home Inc. HOME-NET-192-168-0 (NET-192-168-0-0-1)
"""]
self.mock_get_whois_raw.return_value = ip_whois
self.mock_get_whois_raw.return_value = ip_whois, [None]
self.assertRaises(
errors.SatoriInvalidDomain,
dns.domain_info,

View File

@ -1,9 +1,6 @@
# pep8 with support for empty files through flake8
-e git://github.com/ziadsawalha/pep8.git@19b64e1d6b52cb814e482188369f4db24e0e82c2#egg=pep8
# Newer hacking
# Includes two fixes for handling blank lines in files and for handling egg-linked libraries
-e git://github.com/ziadsawalha/hacking.git@76ff3d0c8b116df147b7e4ca00afda67a9537f2a#egg=hacking
# Includes fixes for handling egg-linked libraries
# and detection of stdlibs in virtualenvs
-e git://github.com/samstav/hacking.git@satori#egg=hacking
coverage>=3.6
discover
@ -11,6 +8,7 @@ flake8_docstrings>=0.2.0 # patched for py33
fixtures>=0.3.14
freezegun
mock>=1.0
pep8>=1.5.7
pep257>=0.3.2 # patched for py33
sphinx>=1.2.2
testrepository>=0.0.17