#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.test_Dump
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Tests for module `Dump`
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2012 Hendrix Demers"
__license__ = ""
# Subversion informations for the file.
__svnRevision__ = "$Revision$"
__svnDate__ = "$Date$"
__svnId__ = "$Id$"
# Standard library modules.
import unittest
import logging
import os
# Third party modules.
# Local modules.
# Project modules
import pymcxray.FileFormat.Results.Dump as Dump
# Globals and constants variables.
[docs]class TestDump(unittest.TestCase):
"""
TestCase class for the module `Dump`.
"""
[docs] def setUp(self):
"""
Setup method.
"""
unittest.TestCase.setUp(self)
self.testDataPath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../test_data"))
[docs] def tearDown(self):
"""
Teardown method.
"""
unittest.TestCase.tearDown(self)
[docs] def testSkeleton(self):
"""
First test to check if the testcase is working with the testing framework.
"""
#self.fail("Test if the testcase is working.")
self.assert_(True)
[docs] def test_read(self):
"""
Tests for method `read`.
"""
filepath = os.path.join(self.testDataPath, "autoSavedFiles", "McXRayDUMP.txt")
dumpFile = Dump.Dump()
dumpFile.read(filepath)
#self.fail("Test if the testcase is working.")
if __name__ == '__main__': #pragma: no cover
logging.getLogger().setLevel(logging.DEBUG)
from pymcxray.Testings import runTestModuleWithCoverage
runTestModuleWithCoverage(__file__)