OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Swarming Authors. All rights reserved. | 2 # Copyright 2014 The Swarming Authors. All rights reserved. |
3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Disable 'Method could be a function.' | 6 # Disable 'Method could be a function.' |
7 # pylint: disable=R0201 | 7 # pylint: disable=R0201 |
8 | 8 |
9 import json | 9 import json |
10 import logging | 10 import logging |
11 import sys | 11 import sys |
12 import unittest | 12 import unittest |
13 | 13 |
14 from test_support import test_env | 14 import test_env |
15 test_env.setup_test_env() | 15 test_env.setup_test_env() |
16 | 16 |
17 import webapp2 | 17 import webapp2 |
18 import webtest | 18 import webtest |
19 | 19 |
20 from google.appengine.ext import ndb | 20 from google.appengine.ext import ndb |
21 | 21 |
22 from components import utils | 22 from components import utils |
23 from components.auth import api | 23 from components.auth import api |
24 from components.auth import handler | 24 from components.auth import handler |
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 self.assertEqual( | 2073 self.assertEqual( |
2074 'http://locahost:1234/some/method?arg=1', response.headers['Location']) | 2074 'http://locahost:1234/some/method?arg=1', response.headers['Location']) |
2075 | 2075 |
2076 | 2076 |
2077 if __name__ == '__main__': | 2077 if __name__ == '__main__': |
2078 if '-v' in sys.argv: | 2078 if '-v' in sys.argv: |
2079 unittest.TestCase.maxDiff = None | 2079 unittest.TestCase.maxDiff = None |
2080 logging.basicConfig( | 2080 logging.basicConfig( |
2081 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) | 2081 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) |
2082 unittest.main() | 2082 unittest.main() |
OLD | NEW |