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

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
« no previous file with comments | « grit/node/structure.py ('k') | grit/testdata/structure_variables.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/node/structure_unittest.py
===================================================================
--- grit/node/structure_unittest.py (revision 124)
+++ grit/node/structure_unittest.py (working copy)
@@ -49,7 +49,7 @@
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 @@
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__':
« no previous file with comments | « grit/node/structure.py ('k') | grit/testdata/structure_variables.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698