Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/config_validation_test.py

Issue 2352203002: [Bisect] Account for tir_label-level summaries in parse_metric (Closed)
Patch Set: fix typo ~_~ Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 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 import copy 6 import copy
7 import os 7 import os
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 with self.assertRaises(config_validation.ValidationFail): 101 with self.assertRaises(config_validation.ValidationFail):
102 config_validation.validate_bisect_config(config, schema) 102 config_validation.validate_bisect_config(config, schema)
103 103
104 def test_validate_metric_format_failure(self): 104 def test_validate_metric_format_failure(self):
105 schema = { 105 schema = {
106 'metric': {'type': 'string'}, 106 'metric': {'type': 'string'},
107 'bisect_mode': {'type': 'string'}, 107 'bisect_mode': {'type': 'string'},
108 } 108 }
109 config = { 109 config = {
110 'bisect_mode': 'mean', 110 'bisect_mode': 'mean',
111 'metric': 'a/b/c', 111 'metric': 'a/b/c/d',
112 } 112 }
113 with self.assertRaises(config_validation.ValidationFail): 113 with self.assertRaises(config_validation.ValidationFail):
114 config_validation.validate_bisect_config(config, schema) 114 config_validation.validate_bisect_config(config, schema)
115 115
116 def test_validate_metric_format_pass(self): 116 def test_validate_metric_format_pass(self):
117 schema = { 117 schema = {
118 'metric': {'type': 'string'}, 118 'metric': {'type': 'string'},
119 'bisect_mode': {'type': 'string'}, 119 'bisect_mode': {'type': 'string'},
120 } 120 }
121 config = { 121 config = {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 def test_validate_choice_failure(self): 168 def test_validate_choice_failure(self):
169 with self.assertRaises(config_validation.ValidationFail): 169 with self.assertRaises(config_validation.ValidationFail):
170 config_validation.validate_key( 170 config_validation.validate_key(
171 config={'x': 3}, 171 config={'x': 3},
172 schema={'x': {'type': 'int', 'choices': [1, 2]}}, 172 schema={'x': {'type': 'int', 'choices': [1, 2]}},
173 key='x') 173 key='x')
174 174
175 175
176 if __name__ == '__main__': 176 if __name__ == '__main__':
177 unittest.main() # pragma: no cover 177 unittest.main() # pragma: no cover
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698