Recent Issues
|
Sign in
with your
Google
Account to create issues and add comments
Issue 81:
Fix CPO memory leak
Unified Diff
File: translate/storage/test_cpo.py
Patch Set: Added tests
Jump to:
Index: translate/storage/test_cpo.py
===================================================================
--- translate/storage/test_cpo.py (revision 8068)
+++ translate/storage/test_cpo.py (working copy)
@@ -72,6 +72,29 @@
unit.addnote("# Double commented comment")
assert unit.getnotes() == "# Double commented comment"
+ 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""
+
+ def test_typecomment(self):
+ unit = self.UnitClass("Comment")
+ assert unit.gettypecomments() == []
+
+ unit.addtypecomment("c-format")
+ assert unit.hastypecomment("c-format")
+ assert unit.gettypecomments() == ["c-format"]
+
+ unit.addtypecomment("invalid-format")
+ assert not unit.hastypecomment("invalid-format")
+ assert unit.gettypecomments() == ["c-format"]
+
+
class TestCPOFile(test_po.TestPOFile):
StoreClass = cpo.pofile
def test_msgidcomments(self):