Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Unified Diff: grit/node/structure_unittest.py

Issue 16539002: GRIT: Enable variable expansion in filenames during HTML inlining. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: grit/node/structure_unittest.py
diff --git a/grit/node/structure_unittest.py b/grit/node/structure_unittest.py
index c07c2bcd730f0702b835dd38076e7f11276e696d..a039bce984b63377e880c9ea5cf42477f26249f3 100644
--- a/grit/node/structure_unittest.py
+++ b/grit/node/structure_unittest.py
@@ -49,7 +49,7 @@ class StructureUnittest(unittest.TestCase):
def testVariables(self):
grd = util.ParseGrdForUnittest('''
<structures>
- <structure type="chrome_html" name="hello_tmpl" file="structure_variables.html" expand_variables="true" variables="GREETING=Hello,THINGS=foo,, bar,, baz,EQUATION=2+2==4"></structure>
+ <structure type="chrome_html" name="hello_tmpl" file="structure_variables.html" expand_variables="true" variables="GREETING=Hello,THINGS=foo,, bar,, baz,EQUATION=2+2==4,filename=simple" flattenhtml="true"></structure>
</structures>''', base_dir=util.PathFromRoot('grit/testdata'))
grd.SetOutputLanguage('en')
grd.RunGatherers()
@@ -57,9 +57,12 @@ class StructureUnittest(unittest.TestCase):
filename = node.Process(tempfile.gettempdir())
with open(os.path.join(tempfile.gettempdir(), filename)) as f:
result = f.read()
- self.failUnless(result == ('<h1>Hello!</h1>\n'
- 'Some cool things are foo, bar, baz.\n'
- 'Did you know that 2+2==4?\n'))
+ self.failUnlessEqual(('<h1>Hello!</h1>\n'
+ 'Some cool things are foo, bar, baz.\n'
+ 'Did you know that 2+2==4?\n'
+ '<p>\n'
+ ' Hello!\n'
+ '</p>\n'), result)
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698