def test_backslash_quote_string(self): self.assertEqual(backslash_quote(' foo bar#baz&'), '\\ foo\\ bar\\#baz\\&')
def test_backslash_quote_unknown_char(self): self.assertEqual(backslash_quote('€'), '€')
def test_backslash_quote(self): self.assertEqual(backslash_quote(''), '') self.assertEqual(backslash_quote(' '), '\\ ') self.assertEqual(backslash_quote('a'), 'a') self.assertEqual(backslash_quote('@'), '\\@')