import copy
import unittest
from os import path

from agora.stats import PBSVideoStats
from dateutil.parser import parse
from mrjob.protocol import JSONProtocol

HERE = path.abspath(path.dirname(__file__))


class PBSVideoStatsTestcase(unittest.TestCase):
    """
    Test agora.stats.PBSVideoStats
    """
    @staticmethod
    def events_generator():
        """
        Parse the output from our VideoCondense mapper.
        """
        protocol = JSONProtocol()
        input_filename = './fixtures/video-stream-mapper-sample'
        with open(path.join(HERE, input_filename), 'r') as f:
            line = f.readline()
            while line:
                key, events = protocol.read(line)
                yield key, events
                line = f.readline()

    @classmethod
    def setup_class(cls):
        """