Test for bug 1513091
Add a test for case with constructed subprocess call. Change-Id: If62c04afdb0f19bab3d9ba87ce0c40a0a3e24739
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user