Fix test_gpg_binary_version_str() to detect correct output from 'gpg --version'.

feature/documentation-builds-dirhtml
Isis Lovecruft 2013-03-18 19:08:14 +00:00
parent 0b6b4ed2ff
commit be303125d1
1 changed files with 8 additions and 3 deletions

View File

@ -125,10 +125,15 @@ class GPGTestCase(unittest.TestCase):
def test_gpg_binary_version_str(self):
"That that 'gpg --version' returns the expected output"
proc = self.gpg._open_subprocess(['--version'])
result = io.StringIO()
result = ""
self.gpg._collect_output(proc, result, stdin=proc.stdin)
result.fpr
self.assertGreater((result.find("AES")), 0)
expected = """gpg (GnuPG) 1.4.12
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permit"""
logger.debug("'gpg --version' returned output:n%s" % result)
self.assertEqual(result, expected)
def test_gpg_binary_not_abs(self):
"Test that a non-absolute path to gpg results in a full path"