Beispiel #1
0
 def test_buf(self):
     html = "<html><input type='text' value='inital value' "\
         + "<% if some_style %> style='color: green;' <% endif %> "\
         + "id='something' onblur='doStuff();' /></html>"
     res = "<html><input type='text' value='${ _(\"inital value\") }' "\
         + "<% if some_style %> style='color: green;' <% endif %> "\
         + "id='something' onblur='doStuff();' /></html>"
     self.assertEqual(add_intl(html), res)
Beispiel #2
0
 def test_buf(self):
     html = "<html><input type='text' value='inital value' "\
         + "<% if some_style %> style='color: green;' <% endif %> "\
         + "id='something' onblur='doStuff();' /></html>"
     res = "<html><input type='text' value='${ _(\"inital value\") }' "\
         + "<% if some_style %> style='color: green;' <% endif %> "\
         + "id='something' onblur='doStuff();' /></html>"
     self.assertEqual(add_intl(html), res)
Beispiel #3
0
 def test_if_tag(self):
     html = '<div id="test" class="\"\n% if mg.signup:' \
         + '\n"container_signup\"\n%endif">'
     res = html
     self.assertEqual(add_intl(html), res)
Beispiel #4
0
 def test_js(self):
     html = "<script>blah blah\ntest value\n\t</script>"
     res = "<script>blah blah\ntest value\n\t</script>"
     self.assertEqual(add_intl(html), res)
Beispiel #5
0
 def test_mako(self):
     html = "% if blah\nThis is a test value\n% endif"
     res = "% if blah\n${ _(\"This is a test value\") }\n% endif"
     self.assertEqual(add_intl(html), res)
Beispiel #6
0
 def test_input_no_slash(self):
     html = '<html><input name="test" value="hello"></html>'
     res = '<html><input name="test" value="${ _("hello") }"></html>'
     self.assertEqual(add_intl(html), res)
Beispiel #7
0
 def test_add_html(self):
     html = "<html>this is a test</html>"
     self.assertEqual(add_intl(html),
             '<html>${ _("this is a test") }</html>')
Beispiel #8
0
 def test_add_simple(self):
     self.assertEqual(add_intl("this is a\nlame test"),
             '${ _("this is a") }\n${ _("lame test") }')
Beispiel #9
0
 def test_if_tag(self):
     html = '<div id="test" class="\"\n% if mg.signup:' \
         + '\n"container_signup\"\n%endif">'
     res = html
     self.assertEqual(add_intl(html), res)
Beispiel #10
0
 def test_js(self):
     html = "<script>blah blah\ntest value\n\t</script>"
     res = "<script>blah blah\ntest value\n\t</script>"
     self.assertEqual(add_intl(html), res)
Beispiel #11
0
 def test_mako(self):
     html = "% if blah\nThis is a test value\n% endif"
     res = "% if blah\n${ _(\"This is a test value\") }\n% endif"
     self.assertEqual(add_intl(html), res)
Beispiel #12
0
 def test_input_no_slash(self):
     html = '<html><input name="test" value="hello"></html>'
     res = '<html><input name="test" value="${ _("hello") }"></html>'
     self.assertEqual(add_intl(html), res)
Beispiel #13
0
 def test_add_html(self):
     html = "<html>this is a test</html>"
     self.assertEqual(add_intl(html),
                      '<html>${ _("this is a test") }</html>')
Beispiel #14
0
 def test_add_simple(self):
     self.assertEqual(add_intl("this is a\nlame test"),
                      '${ _("this is a") }\n${ _("lame test") }')