Recent Issues
|
Sign in
with your
Google
Account to create issues and add comments
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
Jump to:
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"""