| OLD | NEW |
| 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 test that checks postprocessing of files. | 6 '''Unit test that checks postprocessing of files. |
| 7 Tests postprocessing by having the postprocessor | 7 Tests postprocessing by having the postprocessor |
| 8 modify the grd data tree, changing the message name attributes. | 8 modify the grd data tree, changing the message name attributes. |
| 9 ''' | 9 ''' |
| 10 | 10 |
| 11 import os | 11 import os |
| 12 import re | 12 import re |
| 13 import sys | 13 import sys |
| 14 if __name__ == '__main__': | 14 if __name__ == '__main__': |
| 15 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..')) | 15 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../..')) |
| 16 | 16 |
| 17 import unittest | 17 import unittest |
| 18 | 18 |
| 19 import grit.tool.postprocess_interface | 19 import grit.tool.postprocess_interface |
| 20 from grit.tool import rc2grd | 20 from grit.tool import rc2grd |
| 21 | 21 |
| 22 | 22 |
| 23 class PostProcessingUnittest(unittest.TestCase): | 23 class PostProcessingUnittest(unittest.TestCase): |
| 24 | 24 |
| 25 def testPostProcessing(self): | 25 def testPostProcessing(self): |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 for node in messages.children: | 54 for node in messages.children: |
| 55 name_attr = node.attrs['name'] | 55 name_attr = node.attrs['name'] |
| 56 m = smarter.search(name_attr) | 56 m = smarter.search(name_attr) |
| 57 if m: | 57 if m: |
| 58 node.attrs['name'] = 'SMART' + m.group(2) | 58 node.attrs['name'] = 'SMART' + m.group(2) |
| 59 return grdnode | 59 return grdnode |
| 60 | 60 |
| 61 if __name__ == '__main__': | 61 if __name__ == '__main__': |
| 62 unittest.main() | 62 unittest.main() |
| 63 | 63 |
| OLD | NEW |