Chromium Code Reviews| 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 import hashlib | 6 import hashlib |
| 7 import json | 7 import json |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 # Verify the config now shows True. | 352 # Verify the config now shows True. |
| 353 result = self.local_gae.query( | 353 result = self.local_gae.query( |
| 354 'import base_page\n' | 354 'import base_page\n' |
| 355 'q = base_page.GlobalConfig.all()\n' | 355 'q = base_page.GlobalConfig.all()\n' |
| 356 'assert q.count() == 1\n' | 356 'assert q.count() == 1\n' |
| 357 'print q.get().public_access\n') | 357 'print q.get().public_access\n') |
| 358 self.assertEqual('True\n', result) | 358 self.assertEqual('True\n', result) |
| 359 | 359 |
| 360 | 360 |
| 361 if __name__ == '__main__': | 361 if __name__ == '__main__': |
| 362 logging.basicConfig(level= | 362 logging.basicConfig(level=[logging.WARNING, logging.INFO, logging.DEBUG][ |
| 363 [logging.WARNING, logging.INFO, logging.DEBUG][ | 363 min(2, sys.argv.count('-v') + (sys.argv.count('-vv') * 2) + |
| 364 min(2, sys.argv.count('-v'))]) | 364 (sys.argv.count('-vvv') * 3))]) |
|
cmp
2013/11/04 22:27:48
Does optparse natively support this? If it does,
vapier
2013/11/04 22:30:23
shouldn't be hard to rewrite with standard optpars
| |
| 365 unittest.main() | 365 unittest.main() |
| OLD | NEW |