stdout.read() wants bytes, which failed on Py3 str

I don't know how far back the b"byte string" syntax is compatible with this change in Python 2.x, but in 2.7.3 it works as it should.
fix/24-enc-to-file
Mikael Nordfeldth 2013-07-29 00:24:53 +02:00
parent 314e670ada
commit aa6ced5d14
1 changed files with 4 additions and 4 deletions

View File

@ -291,10 +291,10 @@ class GPGTestCase(unittest.TestCase):
"""Test that 'gpg --version' returns the expected output."""
proc = self.gpg._open_subprocess(['--version'])
result = proc.stdout.read(1024)
expected1 = "Supported algorithms:"
expected2 = "Pubkey:"
expected3 = "Cipher:"
expected4 = "Compression:"
expected1 = b"Supported algorithms:"
expected2 = b"Pubkey:"
expected3 = b"Cipher:"
expected4 = b"Compression:"
self.assertGreater(result.find(expected1), 0)
self.assertGreater(result.find(expected2), 0)
self.assertGreater(result.find(expected3), 0)