|
16 | 16 | # limitations under the License. |
17 | 17 | import os |
18 | 18 | import pathlib |
19 | | - |
20 | 19 | from typing import List |
21 | 20 |
|
22 | 21 | import apache_beam as beam |
|
40 | 39 | GT_15M_TRACK_ID = "2004/MIDI-Unprocessed_SMF_02_R1_2004_01-05_ORIG_MID--AUDIO_02_R1_2004_05_Track05_wav" |
41 | 40 |
|
42 | 41 |
|
43 | | -def test_maestro_to_tf_example(tmp_path: pathlib.Path) -> None: |
| 42 | +def test_maestro_to_tf_example(tmp_path: pathlib.Path, mock_maestro_index: None) -> None: |
44 | 43 | mock_maestro_home = tmp_path / "maestro" |
45 | 44 | mock_maestro_ext = mock_maestro_home / "2004" |
46 | 45 | mock_maestro_ext.mkdir(parents=True, exist_ok=True) |
@@ -68,7 +67,7 @@ def test_maestro_to_tf_example(tmp_path: pathlib.Path) -> None: |
68 | 67 | assert len(data) != 0 |
69 | 68 |
|
70 | 69 |
|
71 | | -def test_maestro_invalid_tracks(tmp_path: pathlib.Path) -> None: |
| 70 | +def test_maestro_invalid_tracks(tmp_path: pathlib.Path, mock_maestro_index: None) -> None: |
72 | 71 | mock_maestro_home = tmp_path / "maestro" |
73 | 72 | mock_maestro_ext = mock_maestro_home / "2004" |
74 | 73 | mock_maestro_ext.mkdir(parents=True, exist_ok=True) |
@@ -98,7 +97,7 @@ def test_maestro_invalid_tracks(tmp_path: pathlib.Path) -> None: |
98 | 97 | assert fp.read().strip() == track_id |
99 | 98 |
|
100 | 99 |
|
101 | | -def test_maestro_invalid_tracks_over_15_min(tmp_path: pathlib.Path) -> None: |
| 100 | +def test_maestro_invalid_tracks_over_15_min(tmp_path: pathlib.Path, mock_maestro_index: None) -> None: |
102 | 101 | """ |
103 | 102 | The track id used here is a real track id in maestro, and it is part of the train split, but we mock the data so as |
104 | 103 | not to store a large file in git, hence the variable name. |
@@ -131,13 +130,13 @@ def test_maestro_invalid_tracks_over_15_min(tmp_path: pathlib.Path) -> None: |
131 | 130 | assert fp.read().strip() == "" |
132 | 131 |
|
133 | 132 |
|
134 | | -def test_maestro_create_input_data() -> None: |
| 133 | +def test_maestro_create_input_data(mock_maestro_index: None) -> None: |
135 | 134 | """ |
136 | 135 | A commuted metadata file is included in the repo for testing. mirdata references the metadata file to |
137 | 136 | populate the tracklist with metadata. Since the file is commuted to only the filenames referenced here, |
138 | 137 | we only consider these when testing the metadata. |
139 | 138 | """ |
140 | | - data = create_input_data(str(MAESTRO_TEST_DATA_PATH)) |
| 139 | + data = create_input_data() |
141 | 140 | assert len(data) |
142 | 141 |
|
143 | 142 | test_fnames = {TRAIN_TRACK_ID, VALID_TRACK_ID, TEST_TRACK_ID, GT_15M_TRACK_ID} |
|
0 commit comments