def test_fill_self_cites_tables(self): from invenio.bibrank_selfcites_task import fill_self_cites_tables from invenio.dbquery import run_sql config = {'algorithm': 'friends', 'friends_threshold': 3} fill_self_cites_tables(config) counts = [ run_sql('SELECT count(*) from rnkRECORDSCACHE')[0][0], run_sql('SELECT count(*) from rnkEXTENDEDAUTHORS')[0][0], run_sql('SELECT count(*) from rnkSELFCITES')[0][0], ] self.assert_(counts[0] > 0) self.assert_(counts[1] > 0) self.assert_(counts[2] > 0)
def test_fill_self_cites_tables(self): from invenio.bibrank_selfcites_task import fill_self_cites_tables from invenio.dbquery import run_sql config = {'algorithm':'friends', 'friends_threshold': 3} fill_self_cites_tables(config) counts = [ run_sql('SELECT count(*) from rnkRECORDSCACHE')[0][0], run_sql('SELECT count(*) from rnkEXTENDEDAUTHORS')[0][0], run_sql('SELECT count(*) from rnkSELFCITES')[0][0], ] self.assert_(counts[0] > 0) self.assert_(counts[1] > 0) self.assert_(counts[2] > 0)
def setUp(self): from invenio.bibrank_selfcites_task import fill_self_cites_tables fill_self_cites_tables({'algorithm': 'simple'})