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

Side by Side Diff: tools/generate_stubs/generate_stubs_unittest.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/env python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 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 """Unittest for the generate_stubs.py. 6 """Unittest for the generate_stubs.py.
7 7
8 Since generate_stubs.py is a code generator, it is hard to do a very good 8 Since generate_stubs.py is a code generator, it is hard to do a very good
9 test. Instead of creating a golden-file test, which might be flakey, this 9 test. Instead of creating a golden-file test, which might be flakey, this
10 test elects instead to verify that various components "exist" within the 10 test elects instead to verify that various components "exist" within the
11 generated file as a sanity check. In particular, there is a simple hit 11 generated file as a sanity check. In particular, there is a simple hit
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 msg='Expected "%s" in %s' % (decl, contents)) 274 msg='Expected "%s" in %s' % (decl, contents))
275 decl = gs.PosixStubWriter.InitializeModuleName(name) 275 decl = gs.PosixStubWriter.InitializeModuleName(name)
276 self.assertTrue(contents.find(decl) != -1, 276 self.assertTrue(contents.find(decl) != -1,
277 msg='Expected "%s" in %s' % (decl, contents)) 277 msg='Expected "%s" in %s' % (decl, contents))
278 decl = gs.PosixStubWriter.UninitializeModuleName(name) 278 decl = gs.PosixStubWriter.UninitializeModuleName(name)
279 self.assertTrue(contents.find(decl) != -1, 279 self.assertTrue(contents.find(decl) != -1,
280 msg='Expected "%s" in %s' % (decl, contents)) 280 msg='Expected "%s" in %s' % (decl, contents))
281 281
282 if __name__ == '__main__': 282 if __name__ == '__main__':
283 unittest.main() 283 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698