#!/usr/bin/env python

import os
import unittest
from nose.plugins.attrib import attr

from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.velpt_ab.dcl.resource import RESOURCE_PATH
from mi.dataset.driver.velpt_ab.dcl.velpt_ab_dcl_recovered_driver import parse

__author__ = 'Joe Padula'
log = get_logger()


@attr('UNIT', group='mi')
class SampleTest(unittest.TestCase):

    def test_one(self):

        source_file_path = os.path.join(RESOURCE_PATH, '20140813.velpt.log')

        particle_data_handler = ParticleDataHandler()

        particle_data_handler = parse(None, source_file_path, particle_data_handler)

        log.debug("SAMPLES: %s", particle_data_handler._samples)
        log.debug("FAILURE: %s", particle_data_handler._failure)

        self.assertEquals(particle_data_handler._failure, False)


if __name__ == '__main__':
    test = SampleTest('test_one')
    test.test_one()
