def test_ManyBibTeX(): "Directories with multiple BibTeX files are not allowed" root = os.path.join(TEST_PAPERDIR, 'ManyBibTeX') files = os.listdir(root) with assert_raises(index.IndexError) as cm: index.Paper(root, files) e = cm.exception assert e.msg == "more than one BibTeX file"
def test_Empty(): "Directories with no BibTeX files are not allowed" root = os.path.join(TEST_PAPERDIR, 'Empty') files = os.listdir(root) with assert_raises(index.IndexError) as cm: index.Paper(root, files) e = cm.exception assert e.msg == "no BibTeX file"
def test_NoAuthor(): "BibTeX files without authors are not allowed" root = os.path.join(TEST_PAPERDIR, 'NoAuthor') files = os.listdir(root) paper = index.Paper(root, files) with assert_raises(index.IndexError) as cm: paper.data() e = cm.exception assert e.msg == "BibTeX file does not contain authors"