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

Issue 101: Add setcontext method in PO storage classes

Unified Diff

File: translate/storage/test_po.py
Patch Set: Created 1 year, 3 months ago
Jump to:
View side by-side-diff with in line comments
« translate/storage/pypo.py ('k') | no next file »
Index: translate/storage/test_po.py
===================================================================
--- translate/storage/test_po.py	(revision 8228)
+++ translate/storage/test_po.py	(working copy)
@@ -130,6 +130,16 @@
         unit.source = u"Goeiemôre"
         assert not unit.isheader()
 
+    def test_context(self):
+        unit = self.UnitClass("Message")
+        assert unit.getcontext() == u""
+
+        unit.setcontext("context message")
+        assert unit.getcontext() == u"context message"
+
+        unit.setcontext("")
+        assert unit.getcontext() == u""
+
 class TestPOFile(test_base.TestTranslationStore):
     StoreClass = po.pofile
     def poparse(self, posource):

« translate/storage/pypo.py ('k') | no next file »

Powered by Google App Engine
This is Rietveld r159