Esempio n. 1
0
def test_markall_hhtype(hhtypes, fields, expected):
    bib = {1: ('article', fields)}
    markall(bib,
            hhtypes.triggers,
            verbose=False,
            rank=lambda l: hhtypes[l].rank)
    assert expected in bib[1][1]['hhtype']
Esempio n. 2
0
def test_markall(api, hhtypes):
    bib = {
        1: ('article', {
            'title': "other grammar of lang"
        }),
        2: ('article', {
            'title': "grammar of lang and dial"
        }),
        3: ('article', {
            'title': "other"
        }),
        4: ('article', {
            'title': "grammar and phonologie and morphologie"
        })
    }
    markall(bib,
            hhtypes.triggers,
            verbose=False,
            rank=lambda l: hhtypes[l].rank)
    assert 'grammar' in bib[1][1]['hhtype']
    assert 'morphologie and phonologie;grammar' in bib[4][1]['hhtype']

    markall(bib, api.triggers['lgcode'], verbose=False)
    assert 'language' in bib[1][1]['lgcode']
Esempio n. 3
0
def test_markall_lgcode(api):
    bib = {1: ('article', {'title': "other grammar of lang"})}
    markall(bib, api.triggers['lgcode'], verbose=False)
    assert 'language' in bib[1][1]['lgcode']