test_utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ESPEI 作者: PhasesResearchLab 项目源码 文件源码
def test_adding_bibtex_entries_to_bibliography_db(datasets_db):
    """Adding a BibTeX entries to a database works and the database can be searched."""
    TEST_BIBTEX = """@article{Roe1952gamma,
author = {Roe, W. P. and Fishel, W. P.},
journal = {Trans. Am. Soc. Met.},
keywords = {Fe-Cr,Fe-Ti,Fe-Ti-Cr},
pages = {1030--1041},
title = {{Gamma Loop Studies in the Fe-Ti, Fe-Cr, and Fe-Ti-Cr Systems}},
volume = {44},
year = {1952}
}

@phdthesis{shin2007thesis,
author = {Shin, D},
keywords = {Al-Cu,Al-Cu-Mg,Al-Cu-Si,Al-Mg,Al-Mg-Si,Al-Si,Cu-Mg,Mg-Si,SQS},
number = {May},
school = {The Pennsylvania State University},
title = {{Thermodynamic properties of solid solutions from special quasirandom structures and CALPHAD modeling: Application to aluminum-copper-magnesium-silicon and hafnium-silicon-oxygen}},
year = {2007}
}"""
    db = add_bibtex_to_bib_database(TEST_BIBTEX, datasets_db)
    search_res = db.search(where('ID') == 'Roe1952gamma')
    assert len(search_res) == 1
    assert len(db.all()) == 2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号