| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 dict(name='build_chromium', path='out')) | 545 dict(name='build_chromium', path='out')) |
| 546 | 546 |
| 547 # Dimensions. | 547 # Dimensions. |
| 548 with self.assertRaises(TypeError): | 548 with self.assertRaises(TypeError): |
| 549 mkreq(_gen_request(properties=dict(dimensions=[]))) | 549 mkreq(_gen_request(properties=dict(dimensions=[]))) |
| 550 with self.assertRaises(datastore_errors.BadValueError): | 550 with self.assertRaises(datastore_errors.BadValueError): |
| 551 mkreq(_gen_request(properties=dict(dimensions={}))) | 551 mkreq(_gen_request(properties=dict(dimensions={}))) |
| 552 with self.assertRaises(datastore_errors.BadValueError): | 552 with self.assertRaises(datastore_errors.BadValueError): |
| 553 mkreq(_gen_request( | 553 mkreq(_gen_request( |
| 554 properties=dict(dimensions={u'id': u'b', u'a:': u'b'}))) | 554 properties=dict(dimensions={u'id': u'b', u'a:': u'b'}))) |
| 555 with self.assertRaises(datastore_errors.BadValueError): |
| 556 mkreq(_gen_request( |
| 557 properties=dict(dimensions={u'id': u'b', u'a.': u'b'}))) |
| 555 mkreq(_gen_request( | 558 mkreq(_gen_request( |
| 556 properties=dict(dimensions={u'id': u'b', u'a.': u'b'}))) | 559 properties=dict(dimensions={u'id': u'b', u'pool': u'b'}))) |
| 557 | 560 |
| 558 # Environment. | 561 # Environment. |
| 559 with self.assertRaises(TypeError): | 562 with self.assertRaises(TypeError): |
| 560 mkreq(_gen_request(properties=dict(env=[]))) | 563 mkreq(_gen_request(properties=dict(env=[]))) |
| 561 with self.assertRaises(TypeError): | 564 with self.assertRaises(TypeError): |
| 562 mkreq(_gen_request(properties=dict(env={u'a': 1}))) | 565 mkreq(_gen_request(properties=dict(env={u'a': 1}))) |
| 563 mkreq(_gen_request(properties=dict(env={}))) | 566 mkreq(_gen_request(properties=dict(env={}))) |
| 564 | 567 |
| 565 # Priority. | 568 # Priority. |
| 566 with self.assertRaises(datastore_errors.BadValueError): | 569 with self.assertRaises(datastore_errors.BadValueError): |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 with self.assertRaises(datastore_errors.BadValueError): | 745 with self.assertRaises(datastore_errors.BadValueError): |
| 743 task_request.SecretBytes(secret_bytes='a'*(20*1024+1)).put() | 746 task_request.SecretBytes(secret_bytes='a'*(20*1024+1)).put() |
| 744 | 747 |
| 745 | 748 |
| 746 if __name__ == '__main__': | 749 if __name__ == '__main__': |
| 747 if '-v' in sys.argv: | 750 if '-v' in sys.argv: |
| 748 unittest.TestCase.maxDiff = None | 751 unittest.TestCase.maxDiff = None |
| 749 logging.basicConfig( | 752 logging.basicConfig( |
| 750 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) | 753 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) |
| 751 unittest.main() | 754 unittest.main() |
| OLD | NEW |