Skip to content

Commit 3d06c34

Browse files
author
Clement Champetier
committed
pyTest: added testLibrary to check name and license of libraries
1 parent ad2a8c3 commit 3d06c34

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/pyTest/testLibrary.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from nose.tools import *
2+
3+
from pyAvTranscoder import avtranscoder as av
4+
5+
6+
def testListLibraries():
7+
"""
8+
Check name and license of libraries.
9+
"""
10+
librariesName = set(["avtranscoder", "avutil", "avformat", "avcodec", "avresample", "swresample", "swscale", "avfilter"])
11+
12+
for library in av.getLibraries():
13+
libraryName = library.getName()
14+
if libraryName == "avtranscoder":
15+
assert_equals(library.getLicense(), "GPL v2 or LGPL v2.1")
16+
assert_in(libraryName, librariesName)
17+
librariesName.remove(libraryName)
18+
19+
# avresample or swresample, if avtranscoder depends on libav or ffmpeg
20+
assert_equals(len(librariesName), 1)
21+
22+
23+
def testSupportedExtensions():
24+
"""
25+
Check if we can access the supported extensions.
26+
These numbers of input/output extensions correspond to the features implemented in common libraries (not in third parties).
27+
@note Tested with ffmpeg-2.4.2
28+
"""
29+
inputExtensions = av.getInputExtensions()
30+
outputExtensions = av.getOutputExtensions()
31+
32+
assert_greater_equal(len(inputExtensions), 162)
33+
assert_greater_equal(len(outputExtensions), 184)

0 commit comments

Comments
 (0)