Пример #1
0
    def test_from_bytes(self):
        mailbox = ImapMailbox.from_bytes(
            b'(\\HasNoChildren \\Marked) "/" "INBOX"')

        assert mailbox.__class__ is ImapMailbox

        assert mailbox.name == "INBOX"
        assert mailbox.location == ""
        assert mailbox.delimiter == "/"

        assert not mailbox.has_children

        assert mailbox.is_marked
        assert mailbox.is_selectable

        assert not mailbox.is_draft
        assert not mailbox.is_sent
        assert not mailbox.is_spam
        assert not mailbox.is_trash
Пример #2
0
    def test_from_bytes_exotic_delimiter(self):
        mailbox = ImapMailbox.from_bytes(
            b'(\\HasNoChildren \\Noselect \\Trash) "@" "MyFolder@MySubFolder@MyTestFolder"'
        )

        assert mailbox.__class__ is ImapMailbox

        assert mailbox.name == "MyTestFolder"
        assert mailbox.location == "MyFolder@MySubFolder"
        assert mailbox.delimiter == "@"

        assert not mailbox.has_children

        assert not mailbox.is_marked
        assert not mailbox.is_selectable

        assert not mailbox.is_draft
        assert not mailbox.is_sent
        assert not mailbox.is_spam
        assert mailbox.is_trash
Пример #3
0
    def test_list_mailbox_without_connector(self):
        mailbox = ImapMailbox.from_bytes(
            b'(\\HasNoChildren \\Marked) "/" "INBOX"')

        with pytest.raises(ObjectWithoutConnector):
            mailbox.list_mailbox()