예제 #1
0
def test_full_command_quote():
    """
    Test the full_command_quote function
    """
    assert "command" == full_command_quote('command')
    assert "a 'b' 'c'" == full_command_quote('a', ['b', 'c'])
    assert "safe" == full_command_quote('safe', [])
    assert "a command 'with' 'unsafe '\\''argument'\\'''" == \
           full_command_quote("a command", ["with", "unsafe 'argument'"])
예제 #2
0
파일: fs.py 프로젝트: EnterpriseDB/barman
 def cmd(self, cmd_name, args=[]):
     """
     Execute a command string, escaping it, if necessary
     """
     return self.internal_cmd(full_command_quote(cmd_name, args))