Test for bug 1513091

Add a test for case with constructed subprocess call.

Change-Id: If62c04afdb0f19bab3d9ba87ce0c40a0a3e24739
This commit is contained in:
Stanisław Pitucha
2015-11-05 16:47:51 +11:00
parent 2a328eb786
commit 47ddb67cb5
2 changed files with 5 additions and 2 deletions

View File

@@ -26,3 +26,6 @@ subprocess.check_output('/bin/ls -l', shell=True)
subprocess.Popen('/bin/ls *', shell=True)
subprocess.Popen('/bin/ls %s' % ('something',), shell=True)
subprocess.Popen('/bin/ls {}'.format('something'), shell=True)
command = "/bin/ls" + unknown_function()
subprocess.Popen(command, shell=True)

View File

@@ -297,8 +297,8 @@ class FunctionalTests(testtools.TestCase):
def test_subprocess_shell(self):
'''Test for `subprocess.Popen` with `shell=True`.'''
expect = {
'SEVERITY': {'HIGH': 2, 'MEDIUM': 2, 'LOW': 12},
'CONFIDENCE': {'HIGH': 16}
'SEVERITY': {'HIGH': 3, 'MEDIUM': 2, 'LOW': 12},
'CONFIDENCE': {'HIGH': 17}
}
self.check_example('subprocess_shell.py', expect)