summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2012-09-19 14:10:24 -0400
committerShaun McCance <shaunm@gnome.org>2012-09-19 14:10:24 -0400
commitbec881523df59fb1380f82ab0a789d67c34a58ed (patch)
treeaef68487a42ab21fc840dffda788f85100c94a3f
parentce76559b75fc60ef2a6d69dc99e1781b6adcfe99 (diff)
downloaditstool-bec881523df59fb1380f82ab0a789d67c34a58ed.tar.gz
Adding a test for itst:externalRefRule
Don't know why I never had a test for this before. I'm going to implement the ITS 2.0 External Resource data category, and retool this extension on top, so I need to make sure I don't break it.
-rw-r--r--tests/IT-externalRef1.ll.po31
-rw-r--r--tests/IT-externalRef1.ll.xml10
-rw-r--r--tests/IT-externalRef1.pot31
-rw-r--r--tests/IT-externalRef1.txt1
-rw-r--r--tests/IT-externalRef1.xml10
-rw-r--r--tests/run_tests.py3
6 files changed, 86 insertions, 0 deletions
diff --git a/tests/IT-externalRef1.ll.po b/tests/IT-externalRef1.ll.po
new file mode 100644
index 0000000..204a58a
--- /dev/null
+++ b/tests/IT-externalRef1.ll.po
@@ -0,0 +1,31 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-09-19 14:02-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. (itstool) path: external
+#. This is a reference to an external file such as an image or video. When
+#. the file changes, the md5 hash will change to let you know you need to
+#. update your localized copy. The msgstr is not used at all. Set it to
+#. whatever you like once you have updated your copy of the file.
+#: tests/IT-externalRef1.xml:7
+msgctxt "_"
+msgid "external ref='IT-externalRef1.txt' md5='9cb75ee59c2c7a70be17c5887517a34b'"
+msgstr "external ref='IT-externalRef1.txt' md5='9cb75ee59c2c7a70be17c5887517a34b'"
+
+#. (itstool) path: doc/p
+#: tests/IT-externalRef1.xml:6
+msgid "This is a test of the externalRefRule extension."
+msgstr "Ceci est un test de l'extension externalRefRule."
+
+#. (itstool) path: doc/p
+#: tests/IT-externalRef1.xml:9
+msgid "This has been a test."
+msgstr "Cela a été un test."
+
diff --git a/tests/IT-externalRef1.ll.xml b/tests/IT-externalRef1.ll.xml
new file mode 100644
index 0000000..9f8e4c4
--- /dev/null
+++ b/tests/IT-externalRef1.ll.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<doc xmlns:its="http://www.w3.org/2005/11/its" xmlns:itst="http://itstool.org/extensions/">
+ <its:rules version="1.0">
+ <itst:externalRefRule selector="//external" refPointer="@src"/>
+ </its:rules>
+ <p>Ceci est un test de l'extension externalRefRule.</p>
+ <external src="IT-externalRef1.txt"/>
+ <external its:translate="no" src="devnull"/>
+ <p>Cela a été un test.</p>
+</doc>
diff --git a/tests/IT-externalRef1.pot b/tests/IT-externalRef1.pot
new file mode 100644
index 0000000..f86c901
--- /dev/null
+++ b/tests/IT-externalRef1.pot
@@ -0,0 +1,31 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-09-19 14:02-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. (itstool) path: external
+#. This is a reference to an external file such as an image or video. When
+#. the file changes, the md5 hash will change to let you know you need to
+#. update your localized copy. The msgstr is not used at all. Set it to
+#. whatever you like once you have updated your copy of the file.
+#: tests/IT-externalRef1.xml:7
+msgctxt "_"
+msgid "external ref='IT-externalRef1.txt' md5='9cb75ee59c2c7a70be17c5887517a34b'"
+msgstr ""
+
+#. (itstool) path: doc/p
+#: tests/IT-externalRef1.xml:6
+msgid "This is a test of the externalRefRule extension."
+msgstr ""
+
+#. (itstool) path: doc/p
+#: tests/IT-externalRef1.xml:9
+msgid "This has been a test."
+msgstr ""
+
diff --git a/tests/IT-externalRef1.txt b/tests/IT-externalRef1.txt
new file mode 100644
index 0000000..5adc0ef
--- /dev/null
+++ b/tests/IT-externalRef1.txt
@@ -0,0 +1 @@
+IT-externalRef1
diff --git a/tests/IT-externalRef1.xml b/tests/IT-externalRef1.xml
new file mode 100644
index 0000000..9bc36e0
--- /dev/null
+++ b/tests/IT-externalRef1.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<doc xmlns:its="http://www.w3.org/2005/11/its" xmlns:itst="http://itstool.org/extensions/">
+ <its:rules version="1.0">
+ <itst:externalRefRule selector="//external" refPointer="@src"/>
+ </its:rules>
+ <p>This is a test of the externalRefRule extension.</p>
+ <external src="IT-externalRef1.txt"/>
+ <external its:translate="no" src="devnull"/>
+ <p>This has been a test.</p>
+</doc>
diff --git a/tests/run_tests.py b/tests/run_tests.py
index ed88060..dcd427d 100644
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -242,6 +242,9 @@ class ItstoolTests(unittest.TestCase):
def test_WithinText2(self):
self._test_translation_process('WithinText2.xml')
+ def test_IT_externalRef1(self):
+ self._test_translation_process('IT-externalRef1.xml')
+
def test_IT_locNote_inline(self):
self._test_pot_generation('IT-locNote-inline.xml')