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

Issue 102: Handle typecomments

Unified Diff

File: translate/storage/test_cpo.py
Patch Set: Created 1 year, 3 months ago
Jump to:
View side by-side-diff with in line comments
« translate/storage/cpo.py ('k') | no next file »
Index: translate/storage/test_cpo.py
===================================================================
--- translate/storage/test_cpo.py	(revision 8228)
+++ translate/storage/test_cpo.py	(working copy)
@@ -72,6 +72,16 @@
         unit.addnote("# Double commented comment")
         assert unit.getnotes() == "# Double commented comment"
 
+    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"]
+
+        assert raises(ValueError, unit.addtypecomment, "invalid-format")
+
 class TestCPOFile(test_po.TestPOFile):
     StoreClass = cpo.pofile
     def test_msgidcomments(self):

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

Powered by Google App Engine
This is Rietveld r159