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

Issue 65: xliff2po & po2xliff should handle context

Unified Diff

File: translate/storage/test_pypo.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_pypo.py
===================================================================
--- translate/storage/test_pypo.py	(revision 7897)
+++ translate/storage/test_pypo.py	(working copy)
@@ -141,6 +141,20 @@
         print str(unit)
         assert str(unit) == expected
 
+    def test_context(self):
+        """test context message"""
+        unit = self.UnitClass("Test")
+        #XXX: getcontext() also returns other comments, this is will not be
+        #     tested here
+        assert unit.getcontext() == ''
+
+        unit.setcontext("test context")
+        assert unit.getcontext() == "test context"
+
+        unit.setcontext("")
+        assert unit.getcontext() == ""
+
+
 class TestPYPOFile(test_po.TestPOFile):
     StoreClass = pypo.pofile
     def test_combine_msgidcomments(self):

Powered by Google App Engine
This is Rietveld r159