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

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

Issue 1442863002: Remove contents of grit's SVN repository. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 5 years, 1 month 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/preprocess_interface.py ('k') | grit/tool/rc2grd.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 test that checks preprocessing of files.
7 Tests preprocessing by adding having the preprocessor
8 provide the actual rctext data.
9 '''
10
11 import os
12 import sys
13 if __name__ == '__main__':
14 sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
15
16 import unittest
17
18 import grit.tool.preprocess_interface
19 from grit.tool import rc2grd
20
21
22 class PreProcessingUnittest(unittest.TestCase):
23
24 def testPreProcessing(self):
25 tool = rc2grd.Rc2Grd()
26 class DummyOpts(object):
27 verbose = False
28 extra_verbose = False
29 tool.o = DummyOpts()
30 tool.pre_process = 'grit.tool.preprocess_unittest.DummyPreProcessor'
31 result = tool.Process('', '.\resource.rc')
32
33 self.failUnless(
34 result.children[2].children[2].children[0].attrs['name'] == 'DUMMY_STRING_ 1')
35
36 class DummyPreProcessor(grit.tool.preprocess_interface.PreProcessor):
37 def Process(self, rctext, rcpath):
38 rctext = '''STRINGTABLE
39 BEGIN
40 DUMMY_STRING_1 "String 1"
41 // Some random description
42 DUMMY_STRING_2 "This text was added during preprocessing"
43 END
44 '''
45 return rctext
46
47 if __name__ == '__main__':
48 unittest.main()
49
OLDNEW
« no previous file with comments | « grit/tool/preprocess_interface.py ('k') | grit/tool/rc2grd.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698