Esempio n. 1
0
def test_po2dict_with_plural(nl_po):
    result = po2dict(nl_po)
    values = result["1 field did not validate"]
    assert values == [
        u'%1 fields did not validate', u'1 veld kon niet gevalideerd worden',
        u'%1 velden konden niet gevalideerd worden'
    ]
Esempio n. 2
0
def test_po2dict():
    po = polib.POFile()
    po.metadata = {}
    entry = polib.POEntry(msgid=u'Hello world', msgstr=u'Hallo wereld')
    po.append(entry)

    result = po2dict(po)

    assert result == {'': {}, u'Hello world': [None, u'Hallo wereld']}
Esempio n. 3
0
def test_po2dict():
    po = polib.POFile()
    po.metadata = {}
    entry = polib.POEntry(
        msgid=u'Hello world',
        msgstr=u'Hallo wereld')
    po.append(entry)
    
    result = po2dict(po)

    assert result == {'': {}, u'Hello world': [None, u'Hallo wereld']}
Esempio n. 4
0
def test_po2dict_with_metadata():
    po = polib.POFile()
    po.metadata = {'Project-Id-Version': '1.0'}
    entry = polib.POEntry(
        msgid=u'Hello world',
        msgstr=u'Hallo wereld')
    po.append(entry)
    
    result = po2dict(po)

    assert result == {'': {'Project-Id-Version': '1.0'},
                      'Hello world': [None, u'Hallo wereld']}
Esempio n. 5
0
def test_po2dict_with_metadata():
    po = polib.POFile()
    po.metadata = {'Project-Id-Version': '1.0'}
    entry = polib.POEntry(msgid=u'Hello world', msgstr=u'Hallo wereld')
    po.append(entry)

    result = po2dict(po)

    assert result == {
        '': {
            'Project-Id-Version': '1.0'
        },
        'Hello world': [None, u'Hallo wereld']
    }
Esempio n. 6
0
def test_po2dict_with_plural(nl_po):
    result = po2dict(nl_po)
    values = result["1 field did not validate"]
    assert values == [u'%1 fields did not validate',
                      u'1 veld kon niet gevalideerd worden',
                      u'%1 velden konden niet gevalideerd worden']