コード例 #1
0
 def testSingleQuote_doExpand(self):
     test_string = 'hello $TEST_VAR'
     cmd = 'TEST_VAR=world; echo %s' % cmd_helper.DoubleQuote(test_string)
     self.assertEquals('hello world',
                       cmd_helper.GetCmdOutput(cmd, shell=True).rstrip())
コード例 #2
0
 def testDoubleQuote_withSpaces(self):
     self.assertEquals('"hello world"',
                       cmd_helper.DoubleQuote('hello world'))
コード例 #3
0
 def testDoubleQuote_withUnsafeChars(self):
     self.assertEquals('''"hello\\"; rm -rf /"''',
                       cmd_helper.DoubleQuote('hello"; rm -rf /'))
コード例 #4
0
 def testDoubleQuote_basic(self):
     self.assertEquals('hello', cmd_helper.DoubleQuote('hello'))