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

Issue 62: CPO support for previous messages

Unified Diff

File: translate/storage/test_base.py
Patch Set: Updated accessors, tests and added base.py & test_base.py Created 1 year, 4 months ago
Jump to:
View side by-side-diff with in line comments
Index: translate/storage/test_base.py
===================================================================
--- translate/storage/test_base.py	(revision 7770)
+++ translate/storage/test_base.py	(working copy)
@@ -126,6 +126,32 @@
         actual_notes = unit.getnotes()
         assert actual_notes == expected_notes
 
+    def test_prev_source(self):
+        unit = self.UnitClass("Test")
+        assert not unit.prev_source
+
+        unit.setprev_source("Tested")
+        assert unit.prev_source == "Tested"
+
+        unit.setprev_source("")
+        assert not unit.prev_source
+
+    def test_prev_context(self):
+        unit = self.UnitClass("Test ")
+        assert not unit.prev_context
+
+        unit.setprev_context("Tested Context")
+        assert unit.prev_context == "Tested Context"
+
+        unit.setprev_context("")
+        assert not unit.prev_context
+
+    def test_set_as_previous(self):
+        unit = self.UnitClass("Test")
+        unit.set_as_previous()
+        assert unit.prev_source == "Test"
+
+
 class TestTranslationStore:
     """Tests a TranslationStore.
     Derived classes can reuse these tests by pointing StoreClass to a derived Store"""

Powered by Google App Engine
This is Rietveld r159