Skip to content

Commit 4cc3848

Browse files
author
Clement Champetier
committed
pyTest: fix indentation
According to PEP8, spaces are the preferred indentation method. http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces
1 parent 32b39c8 commit 4cc3848

13 files changed

+1024
-1024
lines changed

test/pyTest/testEProcessMethod.py

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Check if environment is setup to run the tests
44
if os.environ.get('AVTRANSCODER_TEST_VIDEO_AVI_FILE') is None or os.environ.get('AVTRANSCODER_TEST_AUDIO_MOV_FILE') is None or os.environ.get('AVTRANSCODER_TEST_AUDIO_WAVE_FILE') is None:
5-
from nose.plugins.skip import SkipTest
6-
raise SkipTest("Need to define environment variables AVTRANSCODER_TEST_VIDEO_AVI_FILE / AVTRANSCODER_TEST_AUDIO_MOV_FILE / AVTRANSCODER_TEST_AUDIO_WAVE_FILE")
5+
from nose.plugins.skip import SkipTest
6+
raise SkipTest("Need to define environment variables AVTRANSCODER_TEST_VIDEO_AVI_FILE / AVTRANSCODER_TEST_AUDIO_MOV_FILE / AVTRANSCODER_TEST_AUDIO_WAVE_FILE")
77

88
from nose.tools import *
99

@@ -14,117 +14,117 @@
1414

1515

1616
def testEProcessMethodShortest():
17-
"""
18-
Process with method eProcessMethodShortest, check output duration.
19-
"""
20-
inputFileName_longest = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
21-
inputFileName_shortest = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
22-
outputFileName = "testEProcessMethodShortest.mov"
17+
"""
18+
Process with method eProcessMethodShortest, check output duration.
19+
"""
20+
inputFileName_longest = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
21+
inputFileName_shortest = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
22+
outputFileName = "testEProcessMethodShortest.mov"
2323

24-
ouputFile = av.OutputFile( outputFileName )
25-
transcoder = av.Transcoder( ouputFile )
26-
transcoder.setProcessMethod( av.eProcessMethodShortest )
24+
ouputFile = av.OutputFile( outputFileName )
25+
transcoder = av.Transcoder( ouputFile )
26+
transcoder.setProcessMethod( av.eProcessMethodShortest )
2727

28-
transcoder.add( inputFileName_longest, 0, "" )
29-
transcoder.add( inputFileName_shortest, 0, "" )
28+
transcoder.add( inputFileName_longest, 0, "" )
29+
transcoder.add( inputFileName_shortest, 0, "" )
3030

31-
progress = av.ConsoleProgress()
32-
transcoder.process( progress )
31+
progress = av.ConsoleProgress()
32+
transcoder.process( progress )
3333

34-
# get src file
35-
src_inputFile_shortest = av.InputFile( inputFileName_shortest )
36-
src_properties_shortest = src_inputFile_shortest.getProperties()
34+
# get src file
35+
src_inputFile_shortest = av.InputFile( inputFileName_shortest )
36+
src_properties_shortest = src_inputFile_shortest.getProperties()
3737

38-
# get dst file
39-
dst_inputFile = av.InputFile( outputFileName )
40-
dst_properties = dst_inputFile.getProperties()
38+
# get dst file
39+
dst_inputFile = av.InputFile( outputFileName )
40+
dst_properties = dst_inputFile.getProperties()
4141

42-
assert_equals( dst_properties.getDuration(), src_properties_shortest.getDuration() )
42+
assert_equals( dst_properties.getDuration(), src_properties_shortest.getDuration() )
4343

4444

4545
def testEProcessMethodLongest():
46-
"""
47-
Process with method eProcessMethodLongest, check output duration.
48-
"""
49-
inputFileName_longest = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
50-
inputFileName_shortest = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
51-
outputFileName = "testEProcessMethodLongest.mov"
46+
"""
47+
Process with method eProcessMethodLongest, check output duration.
48+
"""
49+
inputFileName_longest = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
50+
inputFileName_shortest = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
51+
outputFileName = "testEProcessMethodLongest.mov"
5252

53-
ouputFile = av.OutputFile( outputFileName )
54-
transcoder = av.Transcoder( ouputFile )
55-
transcoder.setProcessMethod( av.eProcessMethodLongest )
53+
ouputFile = av.OutputFile( outputFileName )
54+
transcoder = av.Transcoder( ouputFile )
55+
transcoder.setProcessMethod( av.eProcessMethodLongest )
5656

57-
transcoder.add( inputFileName_longest, 0, "" )
58-
transcoder.add( inputFileName_shortest, 0, "" )
57+
transcoder.add( inputFileName_longest, 0, "" )
58+
transcoder.add( inputFileName_shortest, 0, "" )
5959

60-
progress = av.ConsoleProgress()
61-
transcoder.process( progress )
60+
progress = av.ConsoleProgress()
61+
transcoder.process( progress )
6262

6363
# get src file
64-
src_inputFile_longest = av.InputFile( inputFileName_longest )
65-
src_properties_longest = src_inputFile_longest.getProperties()
64+
src_inputFile_longest = av.InputFile( inputFileName_longest )
65+
src_properties_longest = src_inputFile_longest.getProperties()
6666

67-
# get dst file
68-
dst_inputFile = av.InputFile( outputFileName )
69-
dst_properties = dst_inputFile.getProperties()
67+
# get dst file
68+
dst_inputFile = av.InputFile( outputFileName )
69+
dst_properties = dst_inputFile.getProperties()
7070

71-
assert_equals( dst_properties.getDuration(), src_properties_longest.getDuration() )
71+
assert_equals( dst_properties.getDuration(), src_properties_longest.getDuration() )
7272

7373

7474
def testEProcessMethodBasedOnStream():
75-
"""
76-
Process with method testEProcessMethodBasedOnStream, check output duration.
77-
"""
78-
inputFileName_first = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
79-
inputFileName_second = os.environ['AVTRANSCODER_TEST_AUDIO_WAVE_FILE']
80-
inputFileName_third = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
81-
outputFileName = "testEProcessMethodShortest.mov"
75+
"""
76+
Process with method testEProcessMethodBasedOnStream, check output duration.
77+
"""
78+
inputFileName_first = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
79+
inputFileName_second = os.environ['AVTRANSCODER_TEST_AUDIO_WAVE_FILE']
80+
inputFileName_third = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
81+
outputFileName = "testEProcessMethodShortest.mov"
8282

83-
ouputFile = av.OutputFile( outputFileName )
84-
transcoder = av.Transcoder( ouputFile )
85-
transcoder.setProcessMethod( av.eProcessMethodBasedOnStream, 1 )
83+
ouputFile = av.OutputFile( outputFileName )
84+
transcoder = av.Transcoder( ouputFile )
85+
transcoder.setProcessMethod( av.eProcessMethodBasedOnStream, 1 )
8686

87-
transcoder.add( inputFileName_first, 0, "" )
88-
transcoder.add( inputFileName_second, 0, "" )
89-
transcoder.add( inputFileName_third, 0, "" )
87+
transcoder.add( inputFileName_first, 0, "" )
88+
transcoder.add( inputFileName_second, 0, "" )
89+
transcoder.add( inputFileName_third, 0, "" )
9090

91-
progress = av.ConsoleProgress()
92-
transcoder.process( progress )
91+
progress = av.ConsoleProgress()
92+
transcoder.process( progress )
9393

94-
# get src file
95-
src_inputFile_second = av.InputFile( inputFileName_second )
96-
src_properties_second = src_inputFile_second.getProperties()
94+
# get src file
95+
src_inputFile_second = av.InputFile( inputFileName_second )
96+
src_properties_second = src_inputFile_second.getProperties()
9797

98-
# get dst file
99-
dst_inputFile = av.InputFile( outputFileName )
100-
dst_properties = dst_inputFile.getProperties()
98+
# get dst file
99+
dst_inputFile = av.InputFile( outputFileName )
100+
dst_properties = dst_inputFile.getProperties()
101101

102-
assert_equals( dst_properties.getDuration(), src_properties_second.getDuration() )
102+
assert_equals( dst_properties.getDuration(), src_properties_second.getDuration() )
103103

104104

105105
def testEProcessMethodBasedOnDuration():
106-
"""
107-
Process with method eProcessMethodBasedOnDuration, check output duration.
108-
"""
109-
inputFileName_first = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
110-
inputFileName_second = os.environ['AVTRANSCODER_TEST_AUDIO_WAVE_FILE']
111-
inputFileName_third = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
112-
outputFileName = "testEProcessMethodBasedOnDuration.mov"
113-
114-
ouputFile = av.OutputFile( outputFileName )
115-
transcoder = av.Transcoder( ouputFile )
116-
transcoder.setProcessMethod( av.eProcessMethodBasedOnDuration, 0, 50 )
117-
118-
transcoder.add( inputFileName_first, 0, "" )
119-
transcoder.add( inputFileName_second, 0, "" )
120-
transcoder.add( inputFileName_third, 0, "" )
121-
122-
progress = av.ConsoleProgress()
123-
transcoder.process( progress )
124-
125-
# get dst file
126-
dst_inputFile = av.InputFile( outputFileName )
127-
dst_properties = dst_inputFile.getProperties()
128-
129-
assert_equals( dst_properties.getDuration(), 50 )
106+
"""
107+
Process with method eProcessMethodBasedOnDuration, check output duration.
108+
"""
109+
inputFileName_first = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
110+
inputFileName_second = os.environ['AVTRANSCODER_TEST_AUDIO_WAVE_FILE']
111+
inputFileName_third = os.environ['AVTRANSCODER_TEST_AUDIO_MOV_FILE']
112+
outputFileName = "testEProcessMethodBasedOnDuration.mov"
113+
114+
ouputFile = av.OutputFile( outputFileName )
115+
transcoder = av.Transcoder( ouputFile )
116+
transcoder.setProcessMethod( av.eProcessMethodBasedOnDuration, 0, 50 )
117+
118+
transcoder.add( inputFileName_first, 0, "" )
119+
transcoder.add( inputFileName_second, 0, "" )
120+
transcoder.add( inputFileName_third, 0, "" )
121+
122+
progress = av.ConsoleProgress()
123+
transcoder.process( progress )
124+
125+
# get dst file
126+
dst_inputFile = av.InputFile( outputFileName )
127+
dst_properties = dst_inputFile.getProperties()
128+
129+
assert_equals( dst_properties.getDuration(), 50 )
130130

test/pyTest/testNbFrames.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Check if environment is setup to run the tests
44
if os.environ.get('AVTRANSCODER_TEST_VIDEO_AVI_FILE') is None:
5-
from nose.plugins.skip import SkipTest
6-
raise SkipTest("Need to define environment variable AVTRANSCODER_TEST_VIDEO_AVI_FILE")
5+
from nose.plugins.skip import SkipTest
6+
raise SkipTest("Need to define environment variable AVTRANSCODER_TEST_VIDEO_AVI_FILE")
77

88
from nose.tools import *
99

@@ -14,55 +14,55 @@
1414

1515

1616
def testNbFramesVideoRewrap():
17-
"""
18-
Rewrap one video stream, check nb frames.
19-
"""
20-
inputFileName = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
21-
outputFileName = "testNbFramesVideoRewrap.mov"
17+
"""
18+
Rewrap one video stream, check nb frames.
19+
"""
20+
inputFileName = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
21+
outputFileName = "testNbFramesVideoRewrap.mov"
2222

23-
ouputFile = av.OutputFile( outputFileName )
24-
transcoder = av.Transcoder( ouputFile )
23+
ouputFile = av.OutputFile( outputFileName )
24+
transcoder = av.Transcoder( ouputFile )
2525

26-
transcoder.add( inputFileName, 0, "" )
26+
transcoder.add( inputFileName, 0, "" )
2727

28-
progress = av.ConsoleProgress()
29-
transcoder.process( progress )
28+
progress = av.ConsoleProgress()
29+
transcoder.process( progress )
3030

31-
# get src file of rewrap
32-
src_inputFile = av.InputFile( inputFileName )
33-
src_properties = src_inputFile.getProperties()
34-
src_videoStream = src_properties.getVideoProperties()[0]
31+
# get src file of rewrap
32+
src_inputFile = av.InputFile( inputFileName )
33+
src_properties = src_inputFile.getProperties()
34+
src_videoStream = src_properties.getVideoProperties()[0]
3535

36-
# get dst file of rewrap
37-
dst_inputFile = av.InputFile( outputFileName )
38-
dst_properties = dst_inputFile.getProperties()
39-
dst_videoStream = dst_properties.getVideoProperties()[0]
36+
# get dst file of rewrap
37+
dst_inputFile = av.InputFile( outputFileName )
38+
dst_properties = dst_inputFile.getProperties()
39+
dst_videoStream = dst_properties.getVideoProperties()[0]
4040

41-
assert_equals( src_videoStream.getNbFrames(), dst_videoStream.getNbFrames() )
41+
assert_equals( src_videoStream.getNbFrames(), dst_videoStream.getNbFrames() )
4242

4343
def testNbFramesVideoTranscode():
44-
"""
45-
Transcode one video stream (to h264), check nb frames.
46-
"""
47-
inputFileName = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
48-
outputFileName = "testNbFramesVideoTranscode.mov"
44+
"""
45+
Transcode one video stream (to h264), check nb frames.
46+
"""
47+
inputFileName = os.environ['AVTRANSCODER_TEST_VIDEO_AVI_FILE']
48+
outputFileName = "testNbFramesVideoTranscode.mov"
4949

50-
ouputFile = av.OutputFile( outputFileName )
51-
transcoder = av.Transcoder( ouputFile )
50+
ouputFile = av.OutputFile( outputFileName )
51+
transcoder = av.Transcoder( ouputFile )
5252

53-
transcoder.add( inputFileName, 0, "mpeg2" )
53+
transcoder.add( inputFileName, 0, "mpeg2" )
5454

55-
progress = av.ConsoleProgress()
56-
transcoder.process( progress )
55+
progress = av.ConsoleProgress()
56+
transcoder.process( progress )
5757

58-
# get src file of transcode
59-
src_inputFile = av.InputFile( inputFileName )
60-
src_properties = src_inputFile.getProperties()
61-
src_videoStream = src_properties.getVideoProperties()[0]
58+
# get src file of transcode
59+
src_inputFile = av.InputFile( inputFileName )
60+
src_properties = src_inputFile.getProperties()
61+
src_videoStream = src_properties.getVideoProperties()[0]
6262

63-
# get dst file of transcode
64-
dst_inputFile = av.InputFile( outputFileName )
65-
dst_properties = dst_inputFile.getProperties()
66-
dst_videoStream = dst_properties.getVideoProperties()[0]
63+
# get dst file of transcode
64+
dst_inputFile = av.InputFile( outputFileName )
65+
dst_properties = dst_inputFile.getProperties()
66+
dst_videoStream = dst_properties.getVideoProperties()[0]
6767

68-
assert_equals( src_videoStream.getNbFrames(), dst_videoStream.getNbFrames() )
68+
assert_equals( src_videoStream.getNbFrames(), dst_videoStream.getNbFrames() )

0 commit comments

Comments
 (0)