Recent Issues
|
Sign in
with your
Google
Account to create issues and add comments
Issue 65:
xliff2po & po2xliff should handle context
Unified Diff
File: translate/storage/test_xliff.py
Patch Set: A more complete patch, supporting CPO and pypo
Jump to:
Index: translate/storage/test_xliff.py
===================================================================
--- translate/storage/test_xliff.py (revision 7897)
+++ translate/storage/test_xliff.py (working copy)
@@ -49,6 +49,25 @@
unit.adderror(errorname='test1', errortext='New error 1.')
assert unit.geterrors()['test1'] == 'New error 1.'
+ def test_contextgroup(self):
+ """tests context groups """
+ unit = self.UnitClass("Group")
+ unit.createcontextgroup('my-group', [('group-type', 'my message')],
+ purpose="test context group")
+ groups = unit.getcontextgroups('my-group')
+ assert len(groups) == 1
+
+ # group = [(type, message)]
+ group = groups[0]
+ print group
+ assert group[0][0] == 'group-type'
+ assert group[0][1] == 'my message'
+
+ unit.delcontextgroup('my-group')
+ groups = unit.getcontextgroups('my-group')
+ assert groups == []
+
+
class TestXLIFFfile(test_base.TestTranslationStore):
StoreClass = xliff.xlifffile
skeleton = '''<?xml version="1.0" encoding="utf-8"?>