| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The LUCI Authors. All rights reserved. | 2 # Copyright 2017 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import datetime | 6 import datetime |
| 7 import hashlib | 7 import hashlib |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 'dimensions': { | 49 'dimensions': { |
| 50 u'cpu': u'x86-64', | 50 u'cpu': u'x86-64', |
| 51 u'os': u'Ubuntu-16.04', | 51 u'os': u'Ubuntu-16.04', |
| 52 u'pool': u'default', | 52 u'pool': u'default', |
| 53 }, | 53 }, |
| 54 'env': {}, | 54 'env': {}, |
| 55 'execution_timeout_secs': 24*60*60, | 55 'execution_timeout_secs': 24*60*60, |
| 56 'io_timeout_secs': None, | 56 'io_timeout_secs': None, |
| 57 } | 57 } |
| 58 props.update(properties or {}) | 58 props.update(properties or {}) |
| 59 props['dimensions_dict'] = props.pop('dimensions') |
| 59 now = utils.utcnow() | 60 now = utils.utcnow() |
| 60 args = { | 61 args = { |
| 61 'created_ts': now, | 62 'created_ts': now, |
| 62 'name': 'Request name', | 63 'name': 'Request name', |
| 63 'priority': 50, | 64 'priority': 50, |
| 64 'properties': task_request.TaskProperties(**props), | 65 'properties': task_request.TaskProperties(**props), |
| 65 'expiration_ts': now + datetime.timedelta(seconds=60), | 66 'expiration_ts': now + datetime.timedelta(seconds=60), |
| 66 'tags': [u'tag:1'], | 67 'tags': [u'tag:1'], |
| 67 'user': 'Jesus', | 68 'user': 'Jesus', |
| 68 } | 69 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 self.assert_count(0, task_queues.TaskDimensions) | 323 self.assert_count(0, task_queues.TaskDimensions) |
| 323 self.assertEqual([], task_queues.get_queues(u'bot1')) | 324 self.assertEqual([], task_queues.get_queues(u'bot1')) |
| 324 | 325 |
| 325 | 326 |
| 326 if __name__ == '__main__': | 327 if __name__ == '__main__': |
| 327 if '-v' in sys.argv: | 328 if '-v' in sys.argv: |
| 328 unittest.TestCase.maxDiff = None | 329 unittest.TestCase.maxDiff = None |
| 329 logging.basicConfig( | 330 logging.basicConfig( |
| 330 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) | 331 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) |
| 331 unittest.main() | 332 unittest.main() |
| OLD | NEW |