| Conditions | 1 |
| Total Lines | 18 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 2 |
| CRAP Score | 1.6059 |
| Changes | 0 | ||
| 1 | 1 | import os |
|
| 19 | 1 | @mock.patch('music_album_creation.create_album.inout') |
|
| 20 | 1 | @mock.patch('music_album_creation.create_album.music_lib_directory') |
|
| 21 | def test_integration(mock_music_lib_directory, mock_inout, tmpdir, integration_data): |
||
| 22 | target_directory = str(tmpdir.mkdir('temp-music-library')) |
||
| 23 | runner = CliRunner() |
||
| 24 | mock_music_lib_directory.return_value = target_directory |
||
| 25 | mock_inout.input_youtube_url_dialog.return_value = 'https://www.youtube.com/watch?v=Wjrrgrvq1ew' |
||
| 26 | mock_inout.interactive_track_info_input_dialog.return_value = \ |
||
| 27 | '1. Gasoline - 0:00\n' \ |
||
| 28 | '2. Man vs. God - 0:10\n' |
||
| 29 | mock_inout.track_information_type_dialog.return_value = 'Timestamps' |
||
| 30 | mock_inout.album_directory_path_dialog.return_value = os.path.join(target_directory, 'del/Faith_in_Science') |
||
| 31 | mock_inout.interactive_metadata_dialogs.return_value = {'artist': 'del', 'album-artist': 'del', 'album': 'Faith in Science', 'year': '2019'} |
||
| 32 | |||
| 33 | result = runner.invoke(main, []) |
||
| 34 | print("CAP\n{}\nCAP".format(result.output)) |
||
| 35 | # captured = capsys.readouterr() |
||
| 36 | assert result.exit_code == 0 |
||
| 37 |