2012-12-01 19:41:40 +00:00
|
|
|
from django.test import TestCase
|
|
|
|
|
|
|
|
from binder import models, helpers
|
|
|
|
|
|
|
|
class HelperTests(TestCase):
|
|
|
|
def test_ipinfo_ResolutionFail(self):
|
|
|
|
response = helpers.ip_info("foobar.doesnotexist.local")
|
|
|
|
self.assertEqual([['Error', u'Unable to resolve foobar.doesnotexist.local: [Errno -2] Name or service not known']],
|
|
|
|
response)
|
2015-03-29 17:03:53 +00:00
|
|
|
response = helpers.ip_info("localhost")
|
2015-04-05 00:33:53 +00:00
|
|
|
self.assertEqual([['IPv4 (1)', u'127.0.0.1']],
|
2015-03-29 17:03:53 +00:00
|
|
|
sorted(response))
|