def test_setLoved(script, pid):
    script.call("setLoved", pid, True)
    track = get_metadata(pid)

    assert track.get("loved") == True
def test_setRating(script, pid):
    script.call("setRating", pid, 1)
    track = get_metadata(pid)

    assert track.get("rating") == 1
def test_setGenre(script, pid):
    script.call("setGenre", pid, "ohhh yeaaahhh")
    track = get_metadata(pid)

    assert track.get('genre') == "ohhh yeaaahhh"
def test_setSkipCount(script, pid):
    script.call("setSkipCount", pid, 42)
    track = get_metadata(pid)

    assert track.get('skipped_count') == 42
def test_setPlayCount(script, pid):
    script.call("setPlayCount", pid, 42)
    track = get_metadata(pid)

    assert track.get('played_count') == 42
def test_get_metadata(script, pid):
    meta = get_metadata(pid)

    assert meta.get('persistent_id') == pid
    assert "UFO" in meta.get('name')
    assert meta.get('genre') == "Electronic"