Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_xtm_translations_utils.py

Issue 29906560: Issue 7042 - [XTM Integration] Solve UnicodeDecodeErrors occuring (Closed)
Patch Set: Created Oct. 10, 2018, 1:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/test_xtm_translations_utils.py
diff --git a/tests/test_xtm_translations_utils.py b/tests/test_xtm_translations_utils.py
index 6cd5def9bd89fd248fecb23fa6c374f4054d0f29..05fd1b28961b172f57e4df29ce1897794f04ace2 100644
--- a/tests/test_xtm_translations_utils.py
+++ b/tests/test_xtm_translations_utils.py
@@ -12,6 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import unicode_literals
Vasily Kuznetsov 2018/10/10 14:01:26 Nit: empty line after the top comment
Tudor Avram 2018/10/11 13:58:28 Done.
import json
import os
@@ -219,3 +220,11 @@ def test_write_data(toydir, path):
utils.write_to_file(data, str(toydir.join(path)))
assert toydir.join(path).read('rb') == data
+
+
+def test_extract_unicode_strings(tmpsite_with_unicode):
+ """Test correct extraction of unicode strings for translation."""
+ with FileSource(tmpsite_with_unicode) as fs:
+ strings = utils.extract_strings(fs)
+
+ assert '\u1234' in strings['unicode']['simple']['message']

Powered by Google App Engine
This is Rietveld