diff options
Diffstat (limited to 'test/uitests.sikuli/datafiles.py')
-rw-r--r-- | test/uitests.sikuli/datafiles.py | 135 |
1 files changed, 72 insertions, 63 deletions
diff --git a/test/uitests.sikuli/datafiles.py b/test/uitests.sikuli/datafiles.py index 5d11ed0..d1191ca 100644 --- a/test/uitests.sikuli/datafiles.py +++ b/test/uitests.sikuli/datafiles.py @@ -1,21 +1,20 @@ -#!/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')) + _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': { + 'mp3-0.mp3': { 'testdir': _UNITTESTFILES, 'container': 'mp3', 'audio_codec': 'mp3', @@ -24,9 +23,10 @@ class TestData(object): 'album': 'Increase The Dosage', 'track': '1', 'genre': 'Blues', - 'duration': 1.07, - }, - 'mp3-1.mp3': { + 'duration': 1.07 + }, + 'mp3-1.mp3': + { 'testdir': _UNITTESTFILES, 'container': 'mp3', 'audio_codec': 'mp3', @@ -34,67 +34,72 @@ class TestData(object): 'artist': 'Ckz', 'album': 'The Heart EP', 'track': '2/5', - 'duration': 1.07, - }, - 'mp3-2.mp3': { + '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': { + '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': { + 'duration': 0.1 + }, + 'webm-0.webm': + { 'testdir': _UNITTESTFILES, 'container': ['matroska', 'webm'], 'video_codec': 'vp8', 'width': 1920, 'height': 912, - 'duration': 0.43, - }, - 'mp4-0.mp4': { + 'duration': 0.43 + }, + 'mp4-0.mp4': + { 'testdir': _UNITTESTFILES, - 'container': [ - 'mov', - 'mp4', - 'm4a', - '3gp', - '3g2', - 'mj2', - 'isom', - 'mp41', - ], + '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': { + 'duration': 312.37 + }, + 'nuls.mp3': + { 'testdir': _UNITTESTFILES, - 'container': [ - 'mov', - 'mp4', - 'm4a', - '3gp', - '3g2', - 'mj2', - 'M4V', - 'mp42', - 'isom', - ], + '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'], @@ -105,33 +110,38 @@ class TestData(object): 'album': 'The Most Extreme', 'track': '10', 'genre': 'Nonfiction', - 'duration': 2668.8, - }, - 'baby_block.m4v': { + 'duration': 2668.8 + }, + '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 + 'fake_video.mp4': + { 'testdir': _SIKTESTFILES, 'container': 'mp4', 'video_codec': None, 'audio_codec': None, 'width': None, 'height': None, - }, - 'story_stuff.mov': { + }, + 'story_stuff.mov': + { 'testdir': _SIKTESTFILES, 'container': 'mov', 'video_codec': 'h264', 'audio_codec': 'mp3', 'width': 320, 'height': 180, - }, } + } def testfile_attr(self, testfile, default): try: @@ -141,7 +151,7 @@ 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 @@ -153,7 +163,6 @@ class TestData(object): 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: @@ -167,4 +176,4 @@ class TestData(object): TESTFILES = TESTFILES[:1] print(TESTFILES) - return (DATADIR, TESTFILES) + return DATADIR, TESTFILES |