Example #1
0
def test_add_str_artsts():
    graph = MusicalGraph("./data/test/test.pickle")
    worker = Worker(graph)
    try:
        worker.add_artists("Logic")
    except AssertionError:
        pass
Example #2
0
def test_search_process():
    graph = MusicalGraph("./data/test/test.pickle")
    worker = Worker(graph)
    response = worker._search_for_artist("Logic")
    processed = worker._get_artist_meta(response)
    print(processed)
    assert len(processed) == 3
    assert 'id' in processed.keys()
Example #3
0
def test_add_genre():
    graph = MusicalGraph("./data/test/test.pickle")
    worker = Worker(graph)
    worker.add_artists(["Logic"])
    assert len(graph.G.nodes) > 1
Example #4
0
def test_search():
    graph = MusicalGraph("./data/test/test.pickle")
    worker = Worker(graph)
    response = worker._search_for_artist("Logic")
    assert response['name'] == "Logic"
Example #5
0
def test_add_list_artsts():
    graph = MusicalGraph("./data/test/test.pickle")
    worker = Worker(graph)
    worker.add_artists(["Logic"])
    assert "Logic" in graph.G.nodes
Example #6
0
def test_credential():
    graph = MusicalGraph("./data/test/test.pickle")
    worker = Worker(graph)
    worker._generate_token()
Example #7
0
import sys
sys.path.append(".")

import pandas as pd
from MusicalGraph.MusicalGraph import MusicalGraph
from MusicalGraph.Worker import Worker

history_path = "./data/s3/history.csv"
graph_path = "./data/s4/graph.pickle"

graph = MusicalGraph(graph_path)
worker = Worker(graph)

history = pd.read_csv(history_path)
artists = list(history.artist.unique())

worker.add_artists(artists)