Пример #1
0
def get_test_db_with_pubmed_content(with_pm=False):
    "Populate the database with sample content from pubmed."
    db = get_temp_db(clear=True)
    pm = Pubmed(ftp_url=get_test_ftp_url(), local=True)
    pm.populate(db)
    if with_pm:
        return db, pm
    else:
        return db
Пример #2
0
def test_multiple_pmids():
    "Test that pre-existing pmids are correctly handled."
    db = get_temp_db()
    med = Pubmed(ftp_url=get_test_ftp_url(), local=True)
    med.populate(db)
    num_refs = len(db.select_all('text_ref'))
    med.populate(db)
    assert len(db.select_all('text_ref')) == num_refs,\
        "Duplicate pmids allowed to be submitted.."
    return