-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_project.py
69 lines (49 loc) · 1.55 KB
/
test_project.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import project as p
import subprocess
import pytest
def test_check_ffmpeg():
assert p.check_ffmpeg() == True
with pytest.raises(FileNotFoundError):
p.check_ffmpeg('fmpeg')
def test_mkv_directory():
generator = p.mkv_directory()
for value in generator:
assert isinstance(value, str)
with pytest.raises(StopIteration):
next(generator)
def test_get_mkv_tracks():
with pytest.raises(TypeError):
p.get_mkv_tracks(None)
with pytest.raises(subprocess.CalledProcessError):
file = 'null.mkv'
p.get_mkv_tracks(file)
def test_get_tracks_count():
with pytest.raises(TypeError):
tracks = None
p.get_tracks_count(tracks)
def test_set_audio_track_flag():
with pytest.raises(AttributeError):
tracks = None
p.set_audio_track_flag(tracks)
def test_set_sub_track_flag():
with pytest.raises(AttributeError):
tracks = None
p.set_sub_track_flag(tracks)
def test_generate_mkvpropedit_command():
with pytest.raises(TypeError):
file = 'null.mkv'
tracks = None
p.generate_mkvpropedit_command(file, tracks)
def test_yield_terminal_output():
with pytest.raises(TypeError):
file = 'null.mkv'
tracks = None
p.yield_terminal_output(file, tracks)
def test_change_flags():
with pytest.raises(subprocess.CalledProcessError):
file = 'null.mkv'
p.change_flags(file)
def test_begin_process():
with pytest.raises(TypeError):
directory = None
p.begin_process(directory)