def test_simple_fetch_with_two_lines(self): fetch = FetchCommand('TAG') fetch.append_to_resp('12 FETCH (FLAGS (\Seen) BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 3028') self.assertTrue(fetch.wait_data()) fetch.append_to_resp('92))') self.assertFalse(fetch.wait_data())
def test_fetch_only_the_last_message_data(self): fetch = FetchCommand('TAG') fetch.append_to_resp('12 FETCH (FLAGS (\Seen)') # not closed on purpose self.assertTrue(fetch.wait_data()) fetch.append_to_resp('13 FETCH (FLAGS (\Seen)') self.assertTrue(fetch.wait_data()) fetch.append_to_resp(')') self.assertFalse(fetch.wait_data())
def test_fetch_with_litteral(self): fetch = FetchCommand('TAG') fetch.append_to_resp('12 FETCH (FLAGS () BODY[] {13}') fetch.begin_literal_data(13, b'literal (data') fetch.append_to_resp(')') self.assertFalse(fetch.wait_data())
def test_simple_fetch(self): fetch = FetchCommand('TAG') fetch.append_to_resp('12 FETCH (FLAGS (\Seen))') self.assertFalse(fetch.wait_data())