diff options
author | Jesús Eduardo <heckyel@hyperbola.info> | 2018-01-17 21:00:12 -0500 |
---|---|---|
committer | Jesús Eduardo <heckyel@hyperbola.info> | 2018-01-17 21:00:12 -0500 |
commit | be8285a5a06855ecdafa859a2045b17d8d859c49 (patch) | |
tree | ff484836906af0400ea49e0d653658d62ddf86a6 | |
parent | fd73bee4e9fcf8a5aea4a9cb463f6a67b38fb8dd (diff) | |
download | librevideoconverter-be8285a5a06855ecdafa859a2045b17d8d859c49.tar.lz librevideoconverter-be8285a5a06855ecdafa859a2045b17d8d859c49.tar.xz librevideoconverter-be8285a5a06855ecdafa859a2045b17d8d859c49.zip |
pep8 en test/uitests.sikuli/datafiles.py
-rw-r--r-- | test/uitests.sikuli/datafiles.py | 270 |
1 files changed, 135 insertions, 135 deletions
diff --git a/test/uitests.sikuli/datafiles.py b/test/uitests.sikuli/datafiles.py index 4db8b27..6226154 100644 --- a/test/uitests.sikuli/datafiles.py +++ b/test/uitests.sikuli/datafiles.py @@ -1,138 +1,137 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- # Default Device Conversion Parameters -import os - -class TestData(object): - _UNITTESTFILES = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"..","..","..",'testdata')) - _SIKTESTFILES = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),'testdata')) - - _FILES = { - 'mp3-0.mp3': { - 'testdir': _UNITTESTFILES, - 'container': 'mp3', - 'audio_codec': 'mp3', - 'title': 'Invisible Walls', - 'artist': 'Revolution Void', - 'album': 'Increase The Dosage', - 'track': '1', - 'genre': 'Blues', - 'duration': 1.07 - }, - 'mp3-1.mp3': - { - 'testdir': _UNITTESTFILES, - 'container': 'mp3', - 'audio_codec': 'mp3', - 'title': 'Race Lieu', - 'artist': 'Ckz', - 'album': 'The Heart EP', - 'track': '2/5', - 'duration': 1.07 - }, - - 'mp3-2.mp3': - { - 'testdir': _UNITTESTFILES, - 'container': 'mp3', - 'audio_codec': 'mp3', - 'artist': 'This American Life', - 'genre': 'Podcast', - 'title': '#426: Tough Room 2011', - 'duration': 1.09 - }, - - 'theora_with_ogg_extension.ogg': - { - 'testdir': _UNITTESTFILES, - 'container': 'ogg', - 'video_codec': 'theora', - 'width': 320, - 'height': 240, - 'duration': 0.1}, - - 'webm-0.webm': - {'testdir': _UNITTESTFILES, - 'container': ['matroska', 'webm'], - 'video_codec': 'vp8', - 'width': 1920, - 'height': 912, - 'duration': 0.43}, - - 'mp4-0.mp4': - {'testdir': _UNITTESTFILES, - 'container': ['mov', - 'mp4', - 'm4a', - '3gp', - '3g2', - 'mj2', - 'isom', - 'mp41'], - 'video_codec': 'h264', - 'audio_codec': 'aac', - 'width': 640, - 'height': 480, - 'title': 'Africa: Cash for Climate Change?', - 'duration': 312.37}, +import os - 'nuls.mp3': - { - 'testdir': _UNITTESTFILES, - 'container': 'mp3', - 'title': 'Invisible'}, - 'drm.m4v': - { - 'testdir': _UNITTESTFILES, - 'container': ['mov', - 'mp4', - 'm4a', - '3gp', - '3g2', - 'mj2', - 'M4V', - 'mp42', - 'isom'], - 'video_codec': 'none', - 'audio_codec': 'aac', - 'has_drm': ['audio', 'video'], - 'width': 640, - 'height': 480, - 'title': 'Thinkers', - 'artist': 'The Most Extreme', - 'album': 'The Most Extreme', - 'track': '10', - 'genre': 'Nonfiction', - 'duration': 2668.8}, +class TestData(object): - 'baby_block.m4v': - { - 'testdir': _SIKTESTFILES, - 'container': 'm4v', - 'video_codec': 'h264', - 'audio_codec': 'aac', - 'width': 960, - 'height': 540, - }, - 'fake_video.mp4': # this is a fake mp4 file it is a pdf file renamed to an mp4 extension and should fail conversion - { - 'testdir': _SIKTESTFILES, - 'container': 'mp4', - 'video_codec': None, - 'audio_codec': None, - 'width': None, - 'height': None, - }, - 'story_stuff.mov': - {'testdir': _SIKTESTFILES, - 'container': 'mov', - 'video_codec': 'h264', - 'audio_codec': 'mp3', - 'width': 320, - 'height': 180, - } + _UNITTESTFILES = \ + os.path.abspath(os.path.join(os.path.dirname( + os.path.abspath(__file__)), '..', '..', '..', 'testdata')) + _SIKTESTFILES = \ + os.path.abspath(os.path.join(os.path.dirname( + os.path.abspath(__file__)), 'testdata')) - } + _FILES = { + 'mp3-0.mp3': { + 'testdir': _UNITTESTFILES, + 'container': 'mp3', + 'audio_codec': 'mp3', + 'title': 'Invisible Walls', + 'artist': 'Revolution Void', + 'album': 'Increase The Dosage', + 'track': '1', + 'genre': 'Blues', + 'duration': 1.07, + }, + 'mp3-1.mp3': { + 'testdir': _UNITTESTFILES, + 'container': 'mp3', + 'audio_codec': 'mp3', + 'title': 'Race Lieu', + 'artist': 'Ckz', + 'album': 'The Heart EP', + 'track': '2/5', + 'duration': 1.07, + }, + 'mp3-2.mp3': { + 'testdir': _UNITTESTFILES, + 'container': 'mp3', + 'audio_codec': 'mp3', + 'artist': 'This American Life', + 'genre': 'Podcast', + 'title': '#426: Tough Room 2011', + 'duration': 1.09, + }, + 'theora_with_ogg_extension.ogg': { + 'testdir': _UNITTESTFILES, + 'container': 'ogg', + 'video_codec': 'theora', + 'width': 320, + 'height': 240, + 'duration': 0.1, + }, + 'webm-0.webm': { + 'testdir': _UNITTESTFILES, + 'container': ['matroska', 'webm'], + 'video_codec': 'vp8', + 'width': 1920, + 'height': 912, + 'duration': 0.43, + }, + 'mp4-0.mp4': { + 'testdir': _UNITTESTFILES, + 'container': [ + 'mov', + 'mp4', + 'm4a', + '3gp', + '3g2', + 'mj2', + 'isom', + 'mp41', + ], + 'video_codec': 'h264', + 'audio_codec': 'aac', + 'width': 640, + 'height': 480, + 'title': 'Africa: Cash for Climate Change?', + 'duration': 312.37, + }, + 'nuls.mp3': {'testdir': _UNITTESTFILES, 'container': 'mp3', + 'title': 'Invisible'}, + 'drm.m4v': { + 'testdir': _UNITTESTFILES, + 'container': [ + 'mov', + 'mp4', + 'm4a', + '3gp', + '3g2', + 'mj2', + 'M4V', + 'mp42', + 'isom', + ], + 'video_codec': 'none', + 'audio_codec': 'aac', + 'has_drm': ['audio', 'video'], + 'width': 640, + 'height': 480, + 'title': 'Thinkers', + 'artist': 'The Most Extreme', + 'album': 'The Most Extreme', + 'track': '10', + 'genre': 'Nonfiction', + 'duration': 2668.8, + }, + 'baby_block.m4v': { + 'testdir': _SIKTESTFILES, + 'container': 'm4v', + 'video_codec': 'h264', + 'audio_codec': 'aac', + 'width': 960, + 'height': 540, + }, + 'fake_video.mp4': { + 'testdir': _SIKTESTFILES, + 'container': 'mp4', + 'video_codec': None, + 'audio_codec': None, + 'width': None, + 'height': None, + }, + 'story_stuff.mov': { + 'testdir': _SIKTESTFILES, + 'container': 'mov', + 'video_codec': 'h264', + 'audio_codec': 'mp3', + 'width': 320, + 'height': 180, + }, + } def testfile_attr(self, testfile, default): try: @@ -142,17 +141,19 @@ class TestData(object): def directory_list(self, testdir): files_list = [] - for k, v in self._FILES.iteritems(): + for (k, v) in self._FILES.iteritems(): if v.has_key('testdir') and testdir in v['testdir']: files_list.append(k) return files_list def test_data(self, many=True, new=False): """Grab a subset of the test files. - - Default selection is to use the unittest files, - but, if I need extra files, getting them from the sikuli test files dir. + + Default selection is to use the unittest files, + but, if I need extra files, getting them from + the sikuli test files dir. """ + DEFAULT_UNITTESTFILES = ['mp4-0.mp4', 'webm-0.webm'] DEFAULT_SIKTESTFILES = ['baby_block.m4v', 'story_styff.mov'] if new: @@ -166,5 +167,4 @@ class TestData(object): TESTFILES = TESTFILES[:1] print TESTFILES - return DATADIR, TESTFILES - + return (DATADIR, TESTFILES) |