コード例 #1
0
ファイル: base.py プロジェクト: alfonsodg/html5video
    def test_base_encoder(self):
        """
        Basic tests for the BaseEncoder and getting the output file name.
        """

        from html5video.encoders.base import BaseEncoder

        encoder = BaseEncoder('fake_file.mov')

        self.assertEqual('fake_file.avi', encoder.get_output_path('avi'))
コード例 #2
0
ファイル: base.py プロジェクト: alfonsodg/html5video
    def test_path_calculations(self):

        from html5video.encoders.base import BaseEncoder

        test_cases = (
            # No output specified
            ('/my/video2.mov', None, '/my/video2.mp4'),
            # Output is a directory
            ('/my/video1.mov', '/tmp/', '/tmp/video1.mp4'),
            # Output is a specific file path
            ('/my/video3.mov', '/tmp/out3', '/tmp/out3.mp4'),
        )

        for source, in_path, out_path in test_cases:

            e = BaseEncoder(source, in_path)
            self.assertEquals(e.get_output_path('mp4'), out_path)