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: Addressed comments from Patch set #1 Created Oct. 11, 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
« no previous file with comments | « tests/test_site/pages/translate-unicode.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fa7599581034050280872430ad0c596b8ae8a2da 100644
--- a/tests/test_xtm_translations_utils.py
+++ b/tests/test_xtm_translations_utils.py
@@ -13,6 +13,8 @@
# 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
+
import json
import os
@@ -219,3 +221,14 @@ 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(temp_site):
+ """Test correct extraction of unicode strings for translation.
+
+ Testing for presence of "Ͷ" - \u0376.
Vasily Kuznetsov 2018/10/12 09:39:51 Doesn't this line cause an error for you? I get:
Tudor Avram 2018/10/12 10:37:02 Huh, ok. It didn't give me an error, but well, I
+ """
+ with FileSource(temp_site) as fs:
+ strings = utils.extract_strings(fs)
+
+ assert '\u0376' in strings['translate-unicode']['simple']['message']
« no previous file with comments | « tests/test_site/pages/translate-unicode.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld