| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 | |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 import os | |
| 8 import sys | |
| 9 import unittest | |
| 10 | |
| 11 | |
| 12 _gae_sdk_not_on_python_path_message = ''' | |
| 13 You must include the google_appengine SDK directory on PYTHONPATH. | |
| 14 ''' | |
| 15 | |
| 16 | |
| 17 _webtest_not_installed_message = ''' | |
| 18 Could not load webtest python module. You may need to: | |
| 19 sudo apt-get python-webtest | |
| 20 ''' | |
| 21 | |
| 22 | |
| 23 def main(): | |
| 24 try: | |
| 25 import dev_appserver | |
| 26 except ImportError: | |
| 27 print >> sys.stderr, _gae_sdk_not_on_python_path_message | |
| 28 raise | |
| 29 | |
| 30 dev_appserver.fix_sys_path() | |
| 31 | |
| 32 try: | |
| 33 import webtest | |
| 34 except ImportError: | |
| 35 print >> sys.stderr, _webtest_not_installed_message | |
| 36 raise | |
| 37 | |
| 38 tests_path = os.path.dirname(sys.modules[__name__].__file__) | |
| 39 suite = unittest.loader.TestLoader().discover(tests_path, | |
| 40 pattern='*_test.py') | |
| 41 unittest.TextTestRunner(verbosity=2).run(suite) | |
| 42 | |
| 43 | |
| 44 if __name__ == '__main__': | |
| 45 main() | |
| OLD | NEW |