| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """try_job_base.py testcases.""" | 6 """try_job_base.py testcases.""" |
| 7 | 7 |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 import test_env # pylint: disable=W0611 | 10 import test_env # pylint: disable=W0611 |
| 11 | 11 |
| 12 from master import try_job_base | 12 from master import try_job_base |
| 13 | 13 |
| 14 | 14 |
| 15 class PaseOptionsTest(unittest.TestCase): | 15 class PaseOptionsTest(unittest.TestCase): |
| 16 def setUp(self): | 16 def setUp(self): |
| 17 self.DEFAULT = 'DEFAULT' | 17 self.DEFAULT = 'DEFAULT' |
| 18 self.VALID_KEYS = ['linux', 'linux_chromeos', 'mac', 'win'] | 18 self.VALID_KEYS = ['linux', 'linux_chromeos', 'mac', 'win'] |
| 19 | 19 |
| 20 @staticmethod | 20 @staticmethod |
| 21 def _get_default(): | 21 def _get_default(): |
| 22 return { | 22 return { |
| 23 'bot': {}, | 23 'bot': {}, |
| 24 'branch': None, | 24 'branch': None, |
| 25 'clobber': False, | 25 'clobber': False, |
| 26 'email': [], | 26 'email': [], |
| 27 'issue': None, | 27 'issue': None, |
| 28 'name': 'Unnamed', | 28 'name': 'Unnamed', |
| 29 'orig_revision': None, |
| 29 'patch': None, | 30 'patch': None, |
| 30 'patchlevel': 0, | 31 'patchlevel': 0, |
| 31 'patchset': None, | 32 'patchset': None, |
| 32 'project': None, | 33 'project': None, |
| 33 'reason': 'John Doe: Unnamed', | 34 'reason': 'John Doe: Unnamed', |
| 34 'requester': None, | 35 'requester': None, |
| 35 'repository': None, | 36 'repository': None, |
| 36 'revision': None, | 37 'revision': None, |
| 37 'root': None, | 38 'root': None, |
| 38 'testfilter': [], | 39 'testfilter': [], |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 'DUPE=dupe2\n') | 214 'DUPE=dupe2\n') |
| 214 expected = { | 215 expected = { |
| 215 'foo': ['bar'], | 216 'foo': ['bar'], |
| 216 'DUPE': ['dupe1', 'dupe2'], | 217 'DUPE': ['dupe1', 'dupe2'], |
| 217 } | 218 } |
| 218 self.assertEquals(expected, try_job_base.text_to_dict(text)) | 219 self.assertEquals(expected, try_job_base.text_to_dict(text)) |
| 219 | 220 |
| 220 | 221 |
| 221 if __name__ == '__main__': | 222 if __name__ == '__main__': |
| 222 unittest.main() | 223 unittest.main() |
| OLD | NEW |