示例#1
0
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"
示例#2
0
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"
示例#3
0
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"