Example #1
0
def test_path_query_path4_retrieves_expected_subset():
    set_default_paper_matrix()
    nodes = matrix_searcher.path_query(4)
    assert 3 == len(nodes)
    assert paper_nodes[3] in nodes
    assert paper_nodes[6] in nodes
    assert paper_nodes[7] in nodes
Example #2
0
def test_node_query_pub1_retrieves_expected_subset():
    set_default_paper_matrix()
    paths = matrix_searcher.node_query(3)
    assert 5 == len(paths)
    assert paper_paths[0] in paths
    assert paper_paths[2] in paths
    assert paper_paths[4] in paths
    assert paper_paths[5] in paths
    assert paper_paths[6] in paths
Example #3
0
def test_pub1_selected():
    set_default_paper_matrix()
    response = HTTPClient().fetch(url('pub1'))
    assert 200 == response.code
    assert api_content_type == response.headers['content-type']
    assert paper_nodes[3] == json.loads(response.body)['selected_node']
Example #4
0
def test_final_node_query_pub1_retrieves_expected_subset():
    set_default_paper_matrix()
    paths = matrix_searcher.final_node_query(3)
    assert 0 == len(paths)
Example #5
0
def test_final_node_query_researcher_retrieves_expected_subset():
    set_default_paper_matrix()
    paths = matrix_searcher.final_node_query(2)
    assert 2 == len(paths)
    assert paper_paths[6] in paths
    assert paper_paths[9] in paths