OLD | NEW |
1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 import threading | 8 import threading |
9 | 9 |
10 TEST_DIR = os.path.dirname(os.path.abspath(__file__)) | 10 TEST_DIR = os.path.dirname(os.path.abspath(__file__)) |
11 ROOT_DIR = os.path.dirname(TEST_DIR) | 11 ROOT_DIR = os.path.dirname(TEST_DIR) |
12 sys.path.insert(0, ROOT_DIR) | 12 sys.path.insert(0, ROOT_DIR) |
13 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party')) | 13 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party')) |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 self.fail('Expected json request, got normal data; %s' % url) | 106 self.fail('Expected json request, got normal data; %s' % url) |
107 _, expected_kwargs, result = data | 107 _, expected_kwargs, result = data |
108 if callable(expected_kwargs): | 108 if callable(expected_kwargs): |
109 expected_kwargs(kwargs) | 109 expected_kwargs(kwargs) |
110 else: | 110 else: |
111 self.assertEqual(expected_kwargs, kwargs) | 111 self.assertEqual(expected_kwargs, kwargs) |
112 if result is not None: | 112 if result is not None: |
113 return result | 113 return result |
114 return None | 114 return None |
115 self.fail('Unknown request %s %s' % (url, kwargs)) | 115 self.fail('Unknown request %s %s' % (url, kwargs)) |
OLD | NEW |