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