1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

Add FDroidPopen usage test

This commit is contained in:
Dmitriy Bogdanov 2016-02-18 00:45:06 +04:00
parent 7fc55a3847
commit 5d54b761af

View File

@ -149,6 +149,14 @@ class CommonTest(unittest.TestCase):
self.assertIsNotNone(re.search('android:versionName="%s"' % build.version, filedata))
self.assertIsNotNone(re.search('android:versionCode="%s"' % build.vercode, filedata))
def test_fdroid_popen_stderr_redirect(self):
commands = ['sh', '-c', 'echo stdout message && echo stderr message 1>&2']
p = fdroidserver.common.FDroidPopen(commands)
self.assertEqual(p.output, 'stdout message\nstderr message\n')
p = fdroidserver.common.FDroidPopen(commands, stderr_to_stdout=False)
self.assertEqual(p.output, 'stdout message\n')
if __name__ == "__main__":
parser = optparse.OptionParser()