Test Failed
Push — dev ( 5fda06...071855 )
by Konstantinos
04:51
created

tests.test_youtube_title   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A given() 0 5 1
A test_expected_video_title_is_fetched_from_url() 0 7 1
1
import pytest
2
3
4
@pytest.fixture
5
def given(scope='module'):
6
    from music_album_creation.web_parsing import video_title
7
    return type('Given', (), {
8
        'compute_title': video_title
9
    })
10
11
@pytest.mark.network_bound
12
@pytest.mark.parametrize('url, expected_title', [
13
    ('https://www.youtube.com/watch?v=Q3dvbM6Pias', 'Rage Against The Machine - Testify (Official HD Video)'),
14
    ('https://www.youtube.com/watch?v=4U0hCmAzRsg', 'Planet of Zeus - Loyal to the Pack (Official Lyric Video)'),
15
])
16
def test_expected_video_title_is_fetched_from_url(url, expected_title, given):
17
    assert given.compute_title(url) == expected_title
18