# Path: eulcommon/binfile/eudora.py
# class Toc(binfile.BinaryStructure):
# class Message(binfile.BinaryStructure):
#     LENGTH = 278
#     LENGTH = 220
#     def messages(self):


import unittest
import os
from eulcommon.binfile import eudora
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.



TEST_ROOT = os.path.dirname(__file__)
def fixture(fname):
    return os.path.join(TEST_ROOT, 'fixtures', fname)

class TestEudora(unittest.TestCase):
    def test_members(self):
        fname = fixture('In.toc')
        obj = eudora.Toc(fname)

        self.assertEqual(obj.version, 1)
        self.assertEqual(obj.name, 'In')

        messages = list(obj.messages)
        self.assertEqual(len(messages), 2)

        # note: we don't actually test all of the fields here. it's not
        # clear what a few of them actually are, so we only test the ones we
        # know how to interpret.


# Path: eulcommon/binfile/eudora.py
# class Toc(binfile.BinaryStructure):
# class Message(binfile.BinaryStructure):
#     LENGTH = 278
#     LENGTH = 220
#     def messages(self):


# Path: test/test_binfile/test_eudora.py
import unittest
import os
from eulcommon.binfile import eudora

#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.



TEST_ROOT = os.path.dirname(__file__)
def fixture(fname):
    return os.path.join(TEST_ROOT, 'fixtures', fname)

class TestEudora(unittest.TestCase):
    def test_members(self):
        fname = fixture('In.toc')
        obj = eudora.Toc(fname)

        self.assertEqual(obj.version, 1)
        self.assertEqual(obj.name, 'In')

        messages = list(obj.messages)
        self.assertEqual(len(messages), 2)

        # note: we don't actually test all of the fields here. it's not
        # clear what a few of them actually are, so we only test the ones we
        # know how to interpret.


        self.assertTrue(isinstance(messages[0], eudora.Message))