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

Side by Side Diff: grit/format/rc_unittest.py

Issue 9924009: Add c_format as a format option. (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/format/rc.py ('k') | grit/node/empty.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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 grit.format.rc''' 6 '''Unit tests for grit.format.rc'''
7 7
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 ICON IDI_KLONK,IDC_MYICON,14,9,20,20 269 ICON IDI_KLONK,IDC_MYICON,14,9,20,20
270 LTEXT "klonk Version ""yibbee"" 1.0",IDC_STATIC,49,10,119,8, 270 LTEXT "klonk Version ""yibbee"" 1.0",IDC_STATIC,49,10,119,8,
271 SS_NOPREFIX 271 SS_NOPREFIX
272 LTEXT "Copyright (C) 2005",IDC_STATIC,49,20,119,8 272 LTEXT "Copyright (C) 2005",IDC_STATIC,49,20,119,8
273 DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP 273 DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
274 CONTROL "Jack ""Black"" Daniels",IDC_RADIO1,"Button", 274 CONTROL "Jack ""Black"" Daniels",IDC_RADIO1,"Button",
275 BS_AUTORADIOBUTTON,46,51,84,10 275 BS_AUTORADIOBUTTON,46,51,84,10
276 END''') 276 END''')
277 277
278 278
279 def testRelativePath(self):
280 ''' Verify that _MakeRelativePath works in some tricky cases.'''
281 def TestRelativePathCombinations(base_path, other_path, expected_result):
282 ''' Verify that the relative path function works for
283 the given paths regardless of whether or not they end with
284 a trailing slash.'''
285 for path1 in [base_path, base_path + os.path.sep]:
286 for path2 in [other_path, other_path + os.path.sep]:
287 result = rc._MakeRelativePath(path1, path2)
288 self.failUnless(result == expected_result)
289
290 # set-up variables
291 root_dir = 'c:%sa' % os.path.sep
292 result1 = '..%sabc' % os.path.sep
293 path1 = root_dir + 'bc'
294 result2 = 'bc'
295 path2 = '%s%s%s' % (root_dir, os.path.sep, result2)
296 # run the tests
297 TestRelativePathCombinations(root_dir, path1, result1)
298 TestRelativePathCombinations(root_dir, path2, result2)
299
300
301 if __name__ == '__main__': 279 if __name__ == '__main__':
302 unittest.main() 280 unittest.main()
OLDNEW
« no previous file with comments | « grit/format/rc.py ('k') | grit/node/empty.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698