Skip to content

Commit 65e28f8

Browse files
committed
Update tests
1 parent cde312c commit 65e28f8

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

tests/test_probe.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ class TestProbe:
2727
"""Class for testing probe.py module."""
2828

2929
def test_format_info(self):
30-
assert Probe("tests/Dad.mpg").format_info == {
31-
"filename": "tests/Dad.mpg",
30+
assert Probe("sample-video.mp4").format_info == {
31+
"filename": "sample-video.mp4",
3232
"nb_streams": "2",
33-
"format_name": "mpeg",
34-
"format_long_name": "MPEG-PS (MPEG-2 Program Stream)",
35-
"duration": "120.720000",
36-
"size": "21227416",
37-
"bit_rate": "1406720",
33+
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
34+
"format_long_name": "QuickTime / MOV",
35+
"duration": "57.563000",
36+
"size": "5329356",
37+
"bit_rate": "740664",
3838
}
3939

4040
def test_video_info(self):
41-
assert Probe("tests/Dad.mpg").video_info == {
42-
"codec_name": "mpeg1video",
43-
"codec_long_name": "MPEG-1 video",
44-
"width": "352",
45-
"height": "288",
46-
"bit_rate": "1150000",
41+
assert Probe("sample-video.mp4").video_info == {
42+
"codec_name": "h264",
43+
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
44+
"width": "854",
45+
"height": "480",
46+
"bit_rate": "669499",
4747
}
4848

4949
def test_audio_info(self):
50-
assert Probe("tests/Dad.mpg").audio_info == {
51-
"codec_name": "mp2",
52-
"codec_long_name": "MP2 (MPEG audio layer 2)",
50+
assert Probe("sample-video.mp4").audio_info == {
51+
"codec_name": "aac",
52+
"codec_long_name": "AAC (Advanced Audio Coding)",
5353
}
5454

5555
def test_subtitle_info(self):
56-
assert Probe("tests/Dad.mpg").subtitle_info == {}
56+
assert Probe("sample-video.mp4").subtitle_info == {}

tests/test_video.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,29 @@ class TestVideo:
2828

2929
def test_get_name(self):
3030
"""Test TaskList.get_file_name()."""
31-
assert Video("tests/Dad.mpg").get_name() == "Dad"
31+
assert Video("sample-video.mp4").get_name() == "sample-video"
3232

3333
def test_get_name_with_extension(self):
3434
"""Test TaskList.get_file_name() with extension."""
35-
assert Video("tests/Dad.mpg").get_name(with_extension=True) == "Dad.mpg"
35+
assert (
36+
Video("sample-video.mp4").get_name(with_extension=True)
37+
== "sample-video.mp4"
38+
)
3639

3740
def test_video_is_valid_right_duration(self):
38-
assert Video("tests/Dad.mpg").is_valid()
41+
assert Video("sample-video.mp4").is_valid()
3942

4043
def test_video_is_valid_zero_duration(self):
41-
video = Video("tests/Dad.mpg")
44+
video = Video("sample-video.mp4")
4245
video._info.format_info["duration"] = 0
4346
assert not video.is_valid()
4447

4548
def test_video_is_valid_wrong_type(self):
46-
video = Video("tests/Dad.mpg")
49+
video = Video("sample-video.mp4")
4750
video._info.format_info["duration"] = []
4851
assert not video.is_valid()
4952

5053
def test_video_is_valid_wrong_value(self):
51-
video = Video("tests/Dad.mpg")
54+
video = Video("sample-video.mp4")
5255
video._info.format_info["duration"] = "N/A"
5356
assert not video.is_valid()

0 commit comments

Comments
 (0)