# Path: alot/account.py
# class Address:
# class SendingMailFailed(RuntimeError):
# class StoreMailError(Exception):
# class Account:
# class SendmailAccount(Account):
#     def __init__(self, user, domain, case_sensitive=False):
#     def from_string(cls, address, case_sensitive=False):
#     def __repr__(self):
#     def __str__(self):
#     def __cmp(self, other, comparitor):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __init__(self, address=None, aliases=None, alias_regexp=None,
#                  realname=None, gpg_key=None, signature=None,
#                  signature_filename=None, signature_as_attachment=False,
#                  sent_box=None, sent_tags=None, draft_box=None,
#                  draft_tags=None, replied_tags=None, passed_tags=None,
#                  abook=None, sign_by_default=False,
#                  encrypt_by_default="none", encrypt_to_self=None,
#                  message_id_domain=None,
#                  case_sensitive_username=False, **_):
#     def matches_address(self, address):
#     def store_mail(mbx, mail):
#     def store_sent_mail(self, mail):
#     def store_draft_mail(self, mail):
#     async def send_mail(self, mail):
#     def __init__(self, cmd, **kwargs):
#     async def send_mail(self, mail):
# 
# Path: alot/db/message.py
# class Message:
#     def __init__(self, dbman, msg, thread=None):
#     def __str__(self):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __lt__(self, other):
#     def get_email(self):
#     def get_date(self):
#     def get_filename(self):
#     def get_message_id(self):
#     def get_thread_id(self):
#     def get_message_parts(self):
#     def get_tags(self):
#     def get_thread(self):
#     def has_replies(self):
#     def get_replies(self):
#     def get_datestring(self):
#     def get_author(self):
#     def add_tags(self, tags, afterwards=None, remove_rest=False):
#         def myafterwards():
#     def remove_tags(self, tags, afterwards=None):
#         def myafterwards():
#     def get_attachments(self):
#     def _is_attachment(part, ct_override=None):
#     def get_mime_part(self):
#     def set_mime_part(self, mime_part):
#     def get_body_text(self):
#     def matches(self, querystring):
#     def get_mime_tree(self):
#     def _get_mimetree(cls, message):
#     def _get_mime_part_info(mime_part):


import unittest
from unittest import mock
from alot import account
from alot.db import message
    def messageid(self):
        return self.mock_message_id

    @property
    def threadid(self):
        return self.mock_thread_id

    @property
    def date(self):
        return self.mock_date

    @property
    def path(self):
        return self.mock_filename

    @property
    def tags(self):
        return self.mock_tags

    @property
    def properties(self):
        return MockNotmuchMessage.MockProperties()


class TestMessage(unittest.TestCase):

    def test_get_author_email_only(self):
        """Message._from is populated using the 'From' header when only an
        email address is provided.
        """

# Path: alot/account.py
# class Address:
# class SendingMailFailed(RuntimeError):
# class StoreMailError(Exception):
# class Account:
# class SendmailAccount(Account):
#     def __init__(self, user, domain, case_sensitive=False):
#     def from_string(cls, address, case_sensitive=False):
#     def __repr__(self):
#     def __str__(self):
#     def __cmp(self, other, comparitor):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __init__(self, address=None, aliases=None, alias_regexp=None,
#                  realname=None, gpg_key=None, signature=None,
#                  signature_filename=None, signature_as_attachment=False,
#                  sent_box=None, sent_tags=None, draft_box=None,
#                  draft_tags=None, replied_tags=None, passed_tags=None,
#                  abook=None, sign_by_default=False,
#                  encrypt_by_default="none", encrypt_to_self=None,
#                  message_id_domain=None,
#                  case_sensitive_username=False, **_):
#     def matches_address(self, address):
#     def store_mail(mbx, mail):
#     def store_sent_mail(self, mail):
#     def store_draft_mail(self, mail):
#     async def send_mail(self, mail):
#     def __init__(self, cmd, **kwargs):
#     async def send_mail(self, mail):
# 
# Path: alot/db/message.py
# class Message:
#     def __init__(self, dbman, msg, thread=None):
#     def __str__(self):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __lt__(self, other):
#     def get_email(self):
#     def get_date(self):
#     def get_filename(self):
#     def get_message_id(self):
#     def get_thread_id(self):
#     def get_message_parts(self):
#     def get_tags(self):
#     def get_thread(self):
#     def has_replies(self):
#     def get_replies(self):
#     def get_datestring(self):
#     def get_author(self):
#     def add_tags(self, tags, afterwards=None, remove_rest=False):
#         def myafterwards():
#     def remove_tags(self, tags, afterwards=None):
#         def myafterwards():
#     def get_attachments(self):
#     def _is_attachment(part, ct_override=None):
#     def get_mime_part(self):
#     def set_mime_part(self, mime_part):
#     def get_body_text(self):
#     def matches(self, querystring):
#     def get_mime_tree(self):
#     def _get_mimetree(cls, message):
#     def _get_mime_part_info(mime_part):


# Path: tests/db/test_message.py
import unittest
from unittest import mock
from alot import account
from alot.db import message

    def messageid(self):
        return self.mock_message_id

    @property
    def threadid(self):
        return self.mock_thread_id

    @property
    def date(self):
        return self.mock_date

    @property
    def path(self):
        return self.mock_filename

    @property
    def tags(self):
        return self.mock_tags

    @property
    def properties(self):
        return MockNotmuchMessage.MockProperties()


class TestMessage(unittest.TestCase):

    def test_get_author_email_only(self):
        """Message._from is populated using the 'From' header when only an
        email address is provided.
        """

        msg = message.Message(mock.Mock(),