示例#1
0
    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())
示例#2
0
    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())
示例#3
0
    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())
示例#4
0
    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())
示例#5
0
    def test_simple_fetch(self):
        fetch = FetchCommand('TAG')
        fetch.append_to_resp('12 FETCH (FLAGS (\Seen))')

        self.assertFalse(fetch.wait_data())
示例#6
0
    def test_simple_fetch(self):
        fetch = FetchCommand('TAG')
        fetch.append_to_resp('12 FETCH (FLAGS (\Seen))')

        self.assertFalse(fetch.wait_data())