Add io.StringIO subclass for writing gpg process results to a string.

* These .write()s need to be forced to unicode for StringIO to handle them
   correctly.
feature/documentation-builds-dirhtml
Isis Lovecruft 2001-09-17 00:00:00 +00:00 committed by Isis Lovecruft
parent 629d13c27c
commit 34bbf47e60
1 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Copyright © 2008-2013 Vinay Sajip. All rights reserved.
"""
import doctest
import logging
import io
import os.path
import os
import shutil
@ -89,6 +90,13 @@ def compare_keys(k1, k2):
del k2[1]
return k1 != k2
class ResultStringIO(io.StringIO):
def __init__(self):
super(self, io.StringIO).__init__()
def write(self, data):
super(self, io.StringIO).write(unicode(data))
class GPGTestCase(unittest.TestCase):
def setUp(self):
hd = os.path.join(os.getcwd(), 'keys')