def test_tries_to_store_templates(monkeypatch): counters = mock_method_with_counter(monkeypatch, db, 'replace_all_templates') graph_parser.parse('tests/assets/paper.nt') graph_parser.persist_index() assert 1 == counters['invocations'] assert 0 < len(counters['args'][0])
def parse(): clean() from app.graph_parser import graph_parser from app.index_parser import index_parser graph_parser.parse('example-rdfs/tall/paper.nt') # graph_parser.parse('example-rdfs/venti/linkedmdb-latest-dump.nt') graph_parser.persist_index() index_parser.generate_sparse_matrix() clean()
def test_get_tuple_returns_size_three_list(): graph_parser.parse('tests/assets/paper.nt') graph_parser.persist_index() t = index_parser.get_tuple('nod1', ['nod1', 'nod2']) assert isinstance(t, list) assert 3 == len(t)