Changeset 109:bfb2aabc0b11 for imapclient/test/test_response_parser.py
- Timestamp:
- 12/17/09 12:00:01 (2 years ago)
- Branch:
- default
- Files:
-
- 1 modified
-
imapclient/test/test_response_parser.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
imapclient/test/test_response_parser.py
r107 r109 129 129 return dt.astimezone(system_offset).replace(tzinfo=None) 130 130 131 class TestPa tchFetchResponse(object):131 class TestParseFetchResponse(unittest.TestCase): 132 132 133 133 def test_basic(self): 134 parse_fetch_response('4 FETCH ()', {'4': {}}) 134 self.assertEquals(parse_fetch_response('* 4 FETCH ()'), {4: {}}) 135 136 137 def test_simple_pair(self): 138 self.assertEquals(parse_fetch_response('* 23 FETCH (ABC 123 STUFF "hello")'), 139 {'23': {'ABC': 123, 140 'STUFF': 'hello'}}) 141 135 142 136 143 def test_non_fetch(self): 137 self.assertRaises(ParseError, parse_fetch_response, '4 OTHER ()') 144 self.assertRaises(ParseError, parse_fetch_response, '* 4 OTHER ()') 145 146 147 def test_bad_msgid(self): 148 self.assertRaises(ParseError, parse_fetch_response, '* abc FETCH ()') 149 138 150 139 151 def test_UID(self): 140 self.fail() 141 # '''Test UID handling. The UID is returned instead of the given message 142 # ID if present. 143 # ''' 144 # self._parse_test( 145 # ['1 (UID 8)'], 146 # {8: {}} 147 # ) 152 self.assertEquals(parse_fetch_response('* 23 FETCH (UID 76)'), 153 {'76': {}}) 148 154 149 155 … … 177 183 178 184 def test_multiple_fields(self): 185 self.fail() 186 187 def test_multiple_messages(self): 179 188 self.fail() 180 189
