| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The LUCI Authors. All rights reserved. | 2 # Copyright 2014 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 logging | 7 import logging |
| 8 import random | 8 import random |
| 9 import sys | 9 import sys |
| 10 import unittest | 10 import unittest |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 u'pool': u'default', | 81 u'pool': u'default', |
| 82 }, | 82 }, |
| 83 'env': {u'foo': u'bar', u'joe': u'2'}, | 83 'env': {u'foo': u'bar', u'joe': u'2'}, |
| 84 'execution_timeout_secs': 30, | 84 'execution_timeout_secs': 30, |
| 85 'grace_period_secs': 30, | 85 'grace_period_secs': 30, |
| 86 'idempotent': False, | 86 'idempotent': False, |
| 87 'inputs_ref': inputs_ref, | 87 'inputs_ref': inputs_ref, |
| 88 'io_timeout_secs': None, | 88 'io_timeout_secs': None, |
| 89 'has_secret_bytes': 'secret_bytes' in kwargs, | 89 'has_secret_bytes': 'secret_bytes' in kwargs, |
| 90 }) | 90 }) |
| 91 properties['dimensions_dict'] = properties.pop('dimensions') |
| 91 now = utils.utcnow() | 92 now = utils.utcnow() |
| 92 args = { | 93 args = { |
| 93 'created_ts': now, | 94 'created_ts': now, |
| 94 'name': 'Request name', | 95 'name': 'Request name', |
| 95 'priority': 50, | 96 'priority': 50, |
| 96 'properties': properties, | 97 'properties': properties, |
| 97 'expiration_ts': now + datetime.timedelta(seconds=30), | 98 'expiration_ts': now + datetime.timedelta(seconds=30), |
| 98 'tags': [u'tag:1'], | 99 'tags': [u'tag:1'], |
| 99 'user': 'Jesus', | 100 'user': 'Jesus', |
| 100 } | 101 } |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 with self.assertRaises(datastore_errors.BadValueError): | 743 with self.assertRaises(datastore_errors.BadValueError): |
| 743 task_request.SecretBytes(secret_bytes='a'*(20*1024+1)).put() | 744 task_request.SecretBytes(secret_bytes='a'*(20*1024+1)).put() |
| 744 | 745 |
| 745 | 746 |
| 746 if __name__ == '__main__': | 747 if __name__ == '__main__': |
| 747 if '-v' in sys.argv: | 748 if '-v' in sys.argv: |
| 748 unittest.TestCase.maxDiff = None | 749 unittest.TestCase.maxDiff = None |
| 749 logging.basicConfig( | 750 logging.basicConfig( |
| 750 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) | 751 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) |
| 751 unittest.main() | 752 unittest.main() |
| OLD | NEW |