Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PRamoneda committed Nov 30, 2020
1 parent ee9948d commit 2572e70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,24 @@ def mock_check_index(mocker):
return mocker.patch.object(utils, "check_index")


def test_remote_index():
def test_remote_index(httpserver):
httpserver.serve_content(
open("tests/resources/download/acousticbrainz_genre_dataset_little_test.json", "rb").read()
)
REMOTE_INDEX = {
"remote_index": download_utils.RemoteFileMetadata(
filename="acousticbrainz_genre_dataset_little_test.json",
url="https://zenodo.org/record/4274551/files/acousticbrainz_genre_dataset_little_test.json?download=1",
url=httpserver.url,
checksum="7f256c49438022ab493c88f5a1b43e88", # the md5 checksum
destination_dir=".", # relative path for where to unzip the data, or None
),
)
}
DATA = LargeData("acousticbrainz_genre_dataset_little_test.json", remote_index=REMOTE_INDEX)
with open("tests/indexes/acousticbrainz_genre_dataset_little_test.json") as f:
little_index = json.load(f)
assert DATA.index == little_index['tracks']
ind = DATA.index
assert len(ind["tracks"]) == 16
os.remove("mirdata/datasets/indexes/acousticbrainz_genre_dataset_little_test.json")




def test_md5(mocker):
Expand Down

0 comments on commit 2572e70

Please sign in to comment.