Handle Unicode in get_txt.

This commit is contained in:
William Grant
2011-06-03 22:24:21 +10:00
parent a82f3110ea
commit 5f949337d1
3 changed files with 22 additions and 11 deletions
+5 -1
View File
@@ -53,8 +53,12 @@ class TestSignAndVerify(unittest.TestCase):
self.key = read_test_data("test.private")
def dnsfunc(self, domain):
try:
domain = domain.decode('ascii')
except UnicodeDecodeError:
return None
self.assertEqual('test._domainkey.example.com.', domain)
return read_test_data("test.txt").decode('utf-8')
return read_test_data("test.txt")
def test_verifies(self):
# A message verifies after being signed.