def test_escape_quotes(self): s = ssh_remote._escape_quotes('echo "\\"Hello, world!\\""') self.assertEqual(r'echo \"\\\"Hello, world!\\\"\"', s)