# Path: eulcommon/binfile/outlookexpress.py
# class MacIndex(binfile.BinaryStructure):
# class MacIndexMessage(binfile.BinaryStructure):
# class MacMail(binfile.BinaryStructure):
# class MacMailMessage(binfile.BinaryStructure):
# class MacFolder(object):
#     MAGIC_NUMBER = 'FMIn'  # data file is FMDF
#     LENGTH = 52
#     MAGIC_NUMBER = 'FMDF'  # data file (?)
#     MESSAGE = 'MSum'
#     DELETED_MESSAGE = 'MDel'
#     def sanity_check(self):
#     def messages(self):
#     def sanity_check(self):
#     def get_message(self, offset, size):
#     def __init__(self, size, *args, **kwargs):
#     def deleted(self):
#     def data(self):
#     def as_email(self):
#     def __init__(self, folder_path):
#     def count(self):
#     def raw_messages(self):
#     def messages(self):
#     def all_messages(self):
#     def _messages(self, skip_deleted=True):


from email import message
from eulcommon.binfile import outlookexpress
import unittest
import os

TEST_ROOT = os.path.dirname(__file__)
# Outlook Express 4.5 Mac folder directory inside fixtures directory
FIXTURE_FOLDER = os.path.join(TEST_ROOT, 'fixtures', 'oemacfolder')

class TestMacIndex(unittest.TestCase):
    index_filename = os.path.join(FIXTURE_FOLDER, 'Index')
    data_filename = os.path.join(FIXTURE_FOLDER, 'Mail')

    def test_basic_properties(self):
        idx = outlookexpress.MacIndex(self.index_filename)

        self.assertEqual(2, idx.total_messages)
        self.assertTrue(idx.sanity_check())

        not_idx = outlookexpress.MacIndex(self.data_filename)
        self.assertFalse(not_idx.sanity_check())

    def test_messages(self):
        idx = outlookexpress.MacIndex(self.index_filename)
        messages = list(idx.messages)
        self.assertEqual(len(messages), 2)

        self.assertTrue(isinstance(messages[0], outlookexpress.MacIndexMessage))

        self.assertEqual(24, messages[0].offset)
        self.assertEqual(392, messages[0].size)


class TestMacIndex(unittest.TestCase):

# Path: eulcommon/binfile/outlookexpress.py
# class MacIndex(binfile.BinaryStructure):
# class MacIndexMessage(binfile.BinaryStructure):
# class MacMail(binfile.BinaryStructure):
# class MacMailMessage(binfile.BinaryStructure):
# class MacFolder(object):
#     MAGIC_NUMBER = 'FMIn'  # data file is FMDF
#     LENGTH = 52
#     MAGIC_NUMBER = 'FMDF'  # data file (?)
#     MESSAGE = 'MSum'
#     DELETED_MESSAGE = 'MDel'
#     def sanity_check(self):
#     def messages(self):
#     def sanity_check(self):
#     def get_message(self, offset, size):
#     def __init__(self, size, *args, **kwargs):
#     def deleted(self):
#     def data(self):
#     def as_email(self):
#     def __init__(self, folder_path):
#     def count(self):
#     def raw_messages(self):
#     def messages(self):
#     def all_messages(self):
#     def _messages(self, skip_deleted=True):


# Path: test/test_binfile/test_outlookexpress.py
from email import message
from eulcommon.binfile import outlookexpress
import unittest
import os


TEST_ROOT = os.path.dirname(__file__)
# Outlook Express 4.5 Mac folder directory inside fixtures directory
FIXTURE_FOLDER = os.path.join(TEST_ROOT, 'fixtures', 'oemacfolder')

class TestMacIndex(unittest.TestCase):
    index_filename = os.path.join(FIXTURE_FOLDER, 'Index')
    data_filename = os.path.join(FIXTURE_FOLDER, 'Mail')

    def test_basic_properties(self):
        idx = outlookexpress.MacIndex(self.index_filename)

        self.assertEqual(2, idx.total_messages)
        self.assertTrue(idx.sanity_check())

        not_idx = outlookexpress.MacIndex(self.data_filename)
        self.assertFalse(not_idx.sanity_check())

    def test_messages(self):
        idx = outlookexpress.MacIndex(self.index_filename)
        messages = list(idx.messages)
        self.assertEqual(len(messages), 2)

        self.assertTrue(isinstance(messages[0], outlookexpress.MacIndexMessage))

        self.assertEqual(24, messages[0].offset)
        self.assertEqual(392, messages[0].size)


class TestMacIndex(unittest.TestCase):

    index_filename = os.path.join(FIXTURE_FOLDER, 'Index')