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

Side by Side Diff: grit/tool/build_unittest.py

Issue 9958067: Fixing a bug in GRIT where messages with substitutions would (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: 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/tool/build.py ('k') | grit/tool/postprocess_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5
6 '''Unit tests for the 'grit build' tool.
7 '''
8
9 import os
10 import re
11 import sys
12 import tempfile
13 if __name__ == '__main__':
14 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
15
16 import unittest
17
18 from grit import util
19 from grit.tool import build
20
21
22 class BuildUnittest(unittest.TestCase):
23
24 def testFindTranslationsWithSubstitutions(self):
25 # This is a regression test; we had a bug where GRIT would fail to find
26 # messages with substitutions e.g. "Hello [IDS_USER]" where IDS_USER is
27 # another <message>.
28 output_dir = tempfile.mkdtemp()
29 builder = build.RcBuilder()
30 class DummyOpts(object):
31 def __init__(self):
32 self.input = util.PathFromRoot('grit/testdata/substitute.grd')
33 self.verbose = False
34 self.extra_verbose = False
35 builder.Run(DummyOpts(), ['-o', output_dir])
36
37
38 if __name__ == '__main__':
39 unittest.main()
OLDNEW
« no previous file with comments | « grit/tool/build.py ('k') | grit/tool/postprocess_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698