Test Failed
Push — integration-test ( 1937be...abbdf8 )
by Konstantinos
02:03
created

tests.test_create_album_program.test_integration()   A

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
2
import subprocess
3
4
from unittest.mock import Mock
5
from click.testing import CliRunner
6
7
from music_album_creation.create_album import main
8
9
10
11
class TestCreateAlbum:
12
13
    def test_launching(self):
14
        ro = subprocess.run(['create-album', '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
15
        assert ro.returncode == 0
16
17
    def test_main(self):
18
        runner = CliRunner()
19
        result = runner.invoke(main, ['--help'])
20
        assert result.exit_code == 0
21
22
23
def test_integration():
24
    runner = CliRunner()
25
    inout = Mock()
26
27
    inout.logo.return_value = 'Logo'
28
    inout.input_youtube_url_dialog.return_value = 'https://www.youtube.com/watch?v=gkbJLLW6xKo'
29
    inout.interactive_track_info_input_dialog.return_value = \
30
        '1.  Gasoline - 0:00' \
31
        '2.  Man vs. God - 4:30' \
32
        '3.  The Great Liar - 9:56' \
33
        '4.  Revolution Cookbook - 14:59' \
34
        '5.  All These Happy People - 17:54' \
35
        '6.  Your Song - 21:58' \
36
        '7.  Let Them Burn - 26:44' \
37
        '8.  On Parole - 32:40' \
38
        '9.  King of the Circus - 38:04'
39
    inout.track_information_type_dialog.return_value = 'Timestamps'
40
    inout.store_album_dialog.
41
42
    result = runner.invoke(main, ['--help'])
43
44
    assert result.exit_code == 0