コード例 #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'
    ]
コード例 #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']}
コード例 #3
0
ファイル: test_convert.py プロジェクト: fchevitarese/pojson
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']}
コード例 #4
0
ファイル: test_convert.py プロジェクト: fchevitarese/pojson
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']}
コード例 #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']
    }
コード例 #6
0
ファイル: test_convert.py プロジェクト: fchevitarese/pojson
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']