From: msmits@ubuntu.ubuntu-domain Date: Mon, 28 Dec 2009 19:01:43 +0000 (-0600) Subject: Added a (failing) test as a reminder about quoted specials (as per #28) X-Git-Tag: 0.7~59^2~9 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cfb426984880d98b2398b00848488bad5ec06af8;p=imapclient.git Added a (failing) test as a reminder about quoted specials (as per #28) --- diff --git a/imapclient/test/test_response_parser.py b/imapclient/test/test_response_parser.py index 301e8aa..19766e3 100644 --- a/imapclient/test/test_response_parser.py +++ b/imapclient/test/test_response_parser.py @@ -94,6 +94,11 @@ class TestParseResponse(unittest.TestCase): self._test(response, (12, 'foo', literal_text)) + def test_quoted_specials(self): + self._test(r'"foo \"bar\""', ('foo "bar"',)) + self._test(r'"foo\\bar"', (r'foo\bar',)) + + def test_incomplete_tuple(self): self._test_parse_error('abc (1 2', 'Tuple incomplete before "(1 2"') @@ -106,6 +111,8 @@ class TestParseResponse(unittest.TestCase): self._test_parse_error('"abc next', 'No closing quotation: "abc next') + + def _test(self, to_parse, expected, wrap=True): if wrap: # convenience - expected value should be wrapped in another tuple