Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(85)

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 Created 1 year, 4 months ago
Jump to:
View side by-side-diff with in line comments
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"?>

Powered by Google App Engine
This is Rietveld r159