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

Side by Side Diff: grit/node/misc_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/node/misc.py ('k') | grit/node/structure.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 misc.GritNode''' 6 '''Unit tests for misc.GritNode'''
7 7
8 8
9 import os 9 import os
10 import sys 10 import sys
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 <messages> 171 <messages>
172 <message name="IDS_BINGO"> 172 <message name="IDS_BINGO">
173 Bingo 173 Bingo
174 </message> 174 </message>
175 </messages> 175 </messages>
176 <structures> 176 <structures>
177 <structure type="menu" name="IDC_KLONKMENU" encoding="utf-16" file=" klonk.rc" /> 177 <structure type="menu" name="IDC_KLONKMENU" encoding="utf-16" file=" klonk.rc" />
178 </structures> 178 </structures>
179 </release> 179 </release>
180 </grit>'''), util.PathFromRoot('grit/testdata')) 180 </grit>'''), util.PathFromRoot('grit/testdata'))
181 grd.SetOutputContext('en', {})
181 grd.RunGatherers(recursive=True) 182 grd.RunGatherers(recursive=True)
182 183
183 hello = grd.GetNodeById('IDS_HELLO') 184 hello = grd.GetNodeById('IDS_HELLO')
184 aboutbox = grd.GetNodeById('IDD_ABOUTBOX') 185 aboutbox = grd.GetNodeById('IDD_ABOUTBOX')
185 bingo = grd.GetNodeById('IDS_BINGO') 186 bingo = grd.GetNodeById('IDS_BINGO')
186 menu = grd.GetNodeById('IDC_KLONKMENU') 187 menu = grd.GetNodeById('IDC_KLONKMENU')
187 188
188 for node in [hello, aboutbox]: 189 for node in [hello, aboutbox]:
189 self.failUnless(not node.PseudoIsAllowed()) 190 self.failUnless(not node.PseudoIsAllowed())
190 191
(...skipping 11 matching lines...) Expand all
202 for node in [bingo, menu]: 203 for node in [bingo, menu]:
203 try: 204 try:
204 formatter = node.ItemFormatter('rc_all') 205 formatter = node.ItemFormatter('rc_all')
205 formatter.Format(node, 'xyz-pseudo') 206 formatter.Format(node, 'xyz-pseudo')
206 except: 207 except:
207 self.fail('Should not have gotten exception since pseudo is allowed') 208 self.fail('Should not have gotten exception since pseudo is allowed')
208 209
209 210
210 if __name__ == '__main__': 211 if __name__ == '__main__':
211 unittest.main() 212 unittest.main()
OLDNEW
« no previous file with comments | « grit/node/misc.py ('k') | grit/node/structure.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698