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 import logging | 6 import logging |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 import unittest | 9 import unittest |
10 | 10 |
11 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 11 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
12 | 12 |
13 import test_env | 13 import test_env |
14 test_env.setup_test_env() | 14 test_env.setup_test_env() |
15 | 15 |
16 from components import auth | 16 from components import auth |
17 from components import auth_testing | 17 from components import auth_testing |
18 from components import datastore_utils | 18 from components import datastore_utils |
19 from support import test_case | 19 from test_support import test_case |
20 | 20 |
21 import model | 21 import model |
22 | 22 |
23 # Access to a protected member _XXX of a client class | 23 # Access to a protected member _XXX of a client class |
24 # pylint: disable=W0212 | 24 # pylint: disable=W0212 |
25 | 25 |
26 | 26 |
27 def hash_item(content): | 27 def hash_item(content): |
28 h = model.get_hash_algo('default') | 28 h = model.get_hash_algo('default') |
29 h.update(content) | 29 h.update(content) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 self.assertEqual(2, len(list(model.ContentEntry.query(ancestor=k)))) | 68 self.assertEqual(2, len(list(model.ContentEntry.query(ancestor=k)))) |
69 | 69 |
70 | 70 |
71 if __name__ == '__main__': | 71 if __name__ == '__main__': |
72 if '-v' in sys.argv: | 72 if '-v' in sys.argv: |
73 unittest.TestCase.maxDiff = None | 73 unittest.TestCase.maxDiff = None |
74 logging.basicConfig(level=logging.DEBUG) | 74 logging.basicConfig(level=logging.DEBUG) |
75 else: | 75 else: |
76 logging.basicConfig(level=logging.FATAL) | 76 logging.basicConfig(level=logging.FATAL) |
77 unittest.main() | 77 unittest.main() |
OLD | NEW |