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

Side by Side Diff: grit/gather/admin_template_unittest.py

Issue 9965022: Allow substitution of messages as variables in other messages. (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Fix unit tests for policy writers. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « grit/format/resource_map.py ('k') | grit/gather/interface.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 '''Unit tests for the admin template gatherer.''' 6 '''Unit tests for the admin template gatherer.'''
7 7
8 import os 8 import os
9 import sys 9 import sys
10 if __name__ == '__main__': 10 if __name__ == '__main__':
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 <structure type="admin_template" name="IDAT_GOOGLE_DESKTOP_SEARCH" 78 <structure type="admin_template" name="IDAT_GOOGLE_DESKTOP_SEARCH"
79 file="GoogleDesktop.adm" exclude_from_rc="true" /> 79 file="GoogleDesktop.adm" exclude_from_rc="true" />
80 <structure type="txt" name="BINGOBONGO" 80 <structure type="txt" name="BINGOBONGO"
81 file="README.txt" exclude_from_rc="true" /> 81 file="README.txt" exclude_from_rc="true" />
82 </structures> 82 </structures>
83 </release> 83 </release>
84 <outputs> 84 <outputs>
85 <output filename="de_res.rc" type="rc_all" lang="de" /> 85 <output filename="de_res.rc" type="rc_all" lang="de" />
86 </outputs> 86 </outputs>
87 </grit>'''), util.PathFromRoot('grit/testdata')) 87 </grit>'''), util.PathFromRoot('grit/testdata'))
88 grd.SetOutputContext('en', {})
88 grd.RunGatherers(recursive=True) 89 grd.RunGatherers(recursive=True)
89 return grd 90 return grd
90 91
91 def testInGrd(self): 92 def testInGrd(self):
92 grd = self.MakeGrd() 93 grd = self.MakeGrd()
93 cliques = grd.children[0].children[0].children[0].GetCliques() 94 cliques = grd.children[0].children[0].children[0].GetCliques()
94 self.VerifyCliquesFromAdmFile(cliques) 95 self.VerifyCliquesFromAdmFile(cliques)
95 96
96 def testFileIsOutput(self): 97 def testFileIsOutput(self):
97 grd = self.MakeGrd() 98 grd = self.MakeGrd()
98 dirname = tempfile.mkdtemp() 99 dirname = tempfile.mkdtemp()
99 try: 100 try:
100 tool = build.RcBuilder() 101 tool = build.RcBuilder()
101 tool.o = grit_runner.Options() 102 tool.o = grit_runner.Options()
102 tool.output_directory = dirname 103 tool.output_directory = dirname
103 tool.res = grd 104 tool.res = grd
104 tool.Process() 105 tool.Process()
105 106
106 self.failUnless(os.path.isfile( 107 self.failUnless(os.path.isfile(
107 os.path.join(dirname, 'de_GoogleDesktop.adm'))) 108 os.path.join(dirname, 'de_GoogleDesktop.adm')))
108 self.failUnless(os.path.isfile( 109 self.failUnless(os.path.isfile(
109 os.path.join(dirname, 'de_README.txt'))) 110 os.path.join(dirname, 'de_README.txt')))
110 finally: 111 finally:
111 for f in os.listdir(dirname): 112 for f in os.listdir(dirname):
112 os.unlink(os.path.join(dirname, f)) 113 os.unlink(os.path.join(dirname, f))
113 os.rmdir(dirname) 114 os.rmdir(dirname)
114 115
115 if __name__ == '__main__': 116 if __name__ == '__main__':
116 unittest.main() 117 unittest.main()
OLDNEW
« no previous file with comments | « grit/format/resource_map.py ('k') | grit/gather/interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698