示例#1
0
文件: unit.py 项目: claudep/pootle
def test_unit_syncer_locations(unit_syncer):
    unit, unit_class = unit_syncer
    unit.addlocation("FOO")
    syncer = UnitSyncer(unit)
    newunit = syncer.convert(unit_class)
    assert newunit.getlocations() == ["FOO"]
    _test_unit_syncer(unit, newunit)
示例#2
0
def test_unit_syncer_locations(unit_syncer):
    unit, unit_class = unit_syncer
    unit.addlocation("FOO")
    syncer = UnitSyncer(unit)
    newunit = syncer.convert(unit_class)
    assert newunit.getlocations() == ["FOO"]
    _test_unit_syncer(unit, newunit)
示例#3
0
文件: unit.py 项目: claudep/pootle
def test_unit_syncer(unit_syncer):
    unit, unit_class = unit_syncer
    syncer = UnitSyncer(unit)
    newunit = syncer.convert(unit_class)
    assert newunit.istranslated()
    assert not newunit.isfuzzy()
    assert not newunit.isobsolete()
    _test_unit_syncer(unit, newunit)
示例#4
0
def test_unit_syncer(unit_syncer):
    unit, unit_class = unit_syncer
    syncer = UnitSyncer(unit)
    newunit = syncer.convert(unit_class)
    assert newunit.istranslated()
    assert not newunit.isfuzzy()
    assert not newunit.isobsolete()
    _test_unit_syncer(unit, newunit)
示例#5
0
文件: unit.py 项目: claudep/pootle
def test_unit_syncer_untranslated(unit_syncer):
    unit, unit_class = unit_syncer
    syncer = UnitSyncer(unit)
    unit.state = UNTRANSLATED
    unit.target = ""
    unit.save()
    newunit = syncer.convert(unit_class)
    assert not newunit.isfuzzy()
    assert not newunit.isobsolete()
    assert not newunit.istranslated()
    _test_unit_syncer(unit, newunit)
示例#6
0
def test_unit_syncer_untranslated(unit_syncer):
    unit, unit_class = unit_syncer
    syncer = UnitSyncer(unit)
    unit.state = UNTRANSLATED
    unit.target = ""
    unit.save()
    newunit = syncer.convert(unit_class)
    assert not newunit.isfuzzy()
    assert not newunit.isobsolete()
    assert not newunit.istranslated()
    _test_unit_syncer(unit, newunit)
示例#7
0
文件: unit.py 项目: claudep/pootle
def test_unit_syncer_notes(unit_syncer):
    unit, unit_class = unit_syncer
    syncer = UnitSyncer(unit)
    unit.addnote(origin="developer", text="hello")
    newunit = syncer.convert(unit_class)
    assert newunit.getnotes(origin="developer") == "hello"
    _test_unit_syncer(unit, newunit)

    unit.addnote(origin="translator", text="world")
    newunit = syncer.convert(unit_class)
    assert newunit.getnotes(origin="translator") == "world"
    _test_unit_syncer(unit, newunit)
示例#8
0
def test_unit_syncer_notes(unit_syncer):
    unit, unit_class = unit_syncer
    syncer = UnitSyncer(unit)
    unit.addnote(origin="developer", text="hello")
    newunit = syncer.convert(unit_class)
    assert newunit.getnotes(origin="developer") == "hello"
    _test_unit_syncer(unit, newunit)

    unit.addnote(origin="translator", text="world")
    newunit = syncer.convert(unit_class)
    assert newunit.getnotes(origin="translator") == "world"
    _test_unit_syncer(unit, newunit)