Пример #1
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
Пример #2
0
    def get(self, node_param):
        from app.matrix_searcher import matrix_searcher
        from app.persistance import db

        node_index = db.search_node(node_param)

        result = {
                'query': node_param,
                'selected_node': None,
                'query_result': None
        }

        if node_index != None:
            result['selected_node'] = db.get_node(node_index)
            result['query_result'] = matrix_searcher.node_query(node_index)
        else:
            self.set_status(404)

        self.finish(result)
Пример #3
0
def test_node_query_researcher_retrieves_expected_subset():
    set_default_paper_matrix()
    paths = matrix_searcher.node_query(2)
    assert 2 == len(paths)
    assert paper_paths[6] in paths
    assert paper_paths[9] in paths
Пример #4
0
def test_node_query_retrieves_column(monkeypatch):
    counters = mock_method_with_counter(monkeypatch, db, 'get_column')

    matrix_searcher.node_query(2)
    assert 1 == counters['invocations']