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())
def testDoubleQuote_withSpaces(self): self.assertEquals('"hello world"', cmd_helper.DoubleQuote('hello world'))
def testDoubleQuote_withUnsafeChars(self): self.assertEquals('''"hello\\"; rm -rf /"''', cmd_helper.DoubleQuote('hello"; rm -rf /'))
def testDoubleQuote_basic(self): self.assertEquals('hello', cmd_helper.DoubleQuote('hello'))