# Path: mvc/video.py
# class VideoFile(object):
# class Node(object):
#     def __init__(self, filename):
#     def parse(self):
#     def audio_only(self):
#     def get_thumbnail(self, completion, width=None, height=None, type_='.png'):
#         def complete(name):
#     def __init__(self, line="", children=None):
#     def add_node(self, node):
#     def pformat(self, indent=0):
#     def get_by_key(self, key):
#     def __repr__(self):
# def get_indent(line):
# def parse_ffmpeg_output(output):
# def extract_info(ast):
# def get_ffmpeg_output(filepath):
# def get_media_info(filepath):
# def get_thumbnail(filename, width, height, output, completion, skip=0):
#     def run():
# def get_thumbnail_synchronous(filename, width, height, output, skip=0):
# SIZE_RE = re.compile(" (\\d+)x(\\d+)[ ,]")


import os, os.path
import tempfile
import threading
import unittest
import mock
import base
from mvc import video
                self.assertNotEquals(path, None)
                return video.VideoFile(path)

    def test_original_size(self):
        thumbnail = self.generate_thumbnail(-1, -1)
        self.assertEqual(thumbnail.width, 400)
        self.assertEqual(thumbnail.height, 304)

    def test_height_resize(self):
        thumbnail = self.generate_thumbnail(200, -1)
        self.assertEqual(thumbnail.width, 200)
        self.assertEqual(thumbnail.height, 152)

    def test_width_resize(self):
        thumbnail = self.generate_thumbnail(-1, 152)
        self.assertEqual(thumbnail.width, 200)
        self.assertEqual(thumbnail.height, 152)

    def test_both_resize(self):
        thumbnail = self.generate_thumbnail(100, 100)
        self.assertEqual(thumbnail.width, 100)
        self.assertEqual(thumbnail.height, 100)

class VideoFileTest(base.Test):

    def setUp(self):
        base.Test.setUp(self)
        self.video_path = os.path.join(self.testdata_dir,
                                       'theora.ogv')
        self.video = video.VideoFile(self.video_path)

# Path: mvc/video.py
# class VideoFile(object):
# class Node(object):
#     def __init__(self, filename):
#     def parse(self):
#     def audio_only(self):
#     def get_thumbnail(self, completion, width=None, height=None, type_='.png'):
#         def complete(name):
#     def __init__(self, line="", children=None):
#     def add_node(self, node):
#     def pformat(self, indent=0):
#     def get_by_key(self, key):
#     def __repr__(self):
# def get_indent(line):
# def parse_ffmpeg_output(output):
# def extract_info(ast):
# def get_ffmpeg_output(filepath):
# def get_media_info(filepath):
# def get_thumbnail(filename, width, height, output, completion, skip=0):
#     def run():
# def get_thumbnail_synchronous(filename, width, height, output, skip=0):
# SIZE_RE = re.compile(" (\\d+)x(\\d+)[ ,]")


# Path: test/test_video.py
import os, os.path
import tempfile
import threading
import unittest
import mock
import base
from mvc import video

                self.assertNotEquals(path, None)
                return video.VideoFile(path)

    def test_original_size(self):
        thumbnail = self.generate_thumbnail(-1, -1)
        self.assertEqual(thumbnail.width, 400)
        self.assertEqual(thumbnail.height, 304)

    def test_height_resize(self):
        thumbnail = self.generate_thumbnail(200, -1)
        self.assertEqual(thumbnail.width, 200)
        self.assertEqual(thumbnail.height, 152)

    def test_width_resize(self):
        thumbnail = self.generate_thumbnail(-1, 152)
        self.assertEqual(thumbnail.width, 200)
        self.assertEqual(thumbnail.height, 152)

    def test_both_resize(self):
        thumbnail = self.generate_thumbnail(100, 100)
        self.assertEqual(thumbnail.width, 100)
        self.assertEqual(thumbnail.height, 100)

class VideoFileTest(base.Test):

    def setUp(self):
        base.Test.setUp(self)
        self.video_path = os.path.join(self.testdata_dir,
                                       'theora.ogv')
        self.video = video.VideoFile(self.video_path)

        self.video.thumbnails = {}