mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-27 21:41:09 -05:00
TLDInfo: fix internationalized TLD tests and update output
- This reverts commit f3dcd83 and part of commit 30f5e31
This commit is contained in:
parent
c7f3110a60
commit
cfda3dd18c
@ -61,8 +61,7 @@ class TLDInfo(callbacks.Plugin):
|
||||
data = utils.web.getUrl(db + s)
|
||||
except utils.web.Error as e:
|
||||
if "HTTP Error 404:" in str(e):
|
||||
irc.reply("No results found for TLD {} (using "
|
||||
"http://www.iana.org/domains/root/db)".format("."+text))
|
||||
irc.error("No results found for TLD .{}".format(text), Raise=True)
|
||||
else:
|
||||
irc.error("An error occurred while contacting IANA's "
|
||||
"TLD Database.", Raise=True)
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
###
|
||||
|
||||
from sys import version_info
|
||||
from supybot.test import *
|
||||
|
||||
class TLDInfoTestCase(PluginTestCase):
|
||||
@ -40,8 +41,10 @@ class TLDInfoTestCase(PluginTestCase):
|
||||
# https://www.iana.org/domains/root/db/xn--io0a7i
|
||||
# Chinese internationalized domain for 'network' (similar to .net)
|
||||
self.assertNotError('tld xn--io0a7i')
|
||||
# self.assertNotError('tld \u7f51\u7edc')
|
||||
self.assertNotRegexp('tld xn--io0a7i', '.*no results found.*', re.I)
|
||||
# self.assertNotRegexp('tld \u7f51\u7edc', '.*no results found.*', re.I)
|
||||
if version_info[0] > 3:
|
||||
self.assertNotError('tld \u7f51\u7edc')
|
||||
else:
|
||||
from codecs import unicode_escape_decode as u
|
||||
self.assertNotError('tld '+u('\u7f51\u7edc')[0])
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||
|
Loading…
x
Reference in New Issue
Block a user