Tests for Metadata Extraction from Video
========================================

Unittests for metadata_extraction.py without setting up Plone.

    >>> import collective.flowplayer.metadata_extraction as metaex

    >>> import os
    >>> testfile_home = os.path.join(os.path.dirname(__file__), 'tests')

Video Files should return height and width
    >>> metadata = metaex.parse_file(testfile_home + '/barsandtone.flv')
    >>> height, width = metaex.scale_from_metadata(metadata)
    >>> height
    288
    >>> width
    360

    >>> metadata = metaex.parse_file(testfile_home + '/barsandtone.mp4')
    >>> height, width = metaex.scale_from_metadata(metadata)
    >>> height
    288
    >>> width
    360

    >>> metadata = metaex.parse_file(testfile_home + '/barsandtone.mov')
    >>> height, width = metaex.scale_from_metadata(metadata)
    >>> height
    288
    >>> width
    360

Extract Metadata directly from File handle
    >>> file_handle = open(testfile_home + '/barsandtone.flv', 'rb')
    >>> metadata = metaex.parse_raw(file_handle)
    >>> height, width = metaex.scale_from_metadata(metadata)
    >>> file_handle.close()
    >>> height
    288
    >>> width
    360
    >>> file_handle.close()


Audio only FLV files return no height and width
    >>> metadata = metaex.parse_file(testfile_home + '/foo.flv')
    >>> height, width = metaex.scale_from_metadata(metadata)
    >>> height
    >>> width

    >>> interact( locals() )

