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

Unified Diff: scripts/slave/unittests/recipe_configs_test.py

Issue 24737002: Add Paths as first-class types in configs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: license Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/recipes/polymer.py ('k') | scripts/slave/unittests/recipes_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/recipe_configs_test.py
diff --git a/scripts/slave/unittests/recipe_configs_test.py b/scripts/slave/unittests/recipe_configs_test.py
index a56258cc00dd9d7bd0cdb83fda884ae23393be9d..8492e07f46330af594772429e6dc366beffcd6d6 100755
--- a/scripts/slave/unittests/recipe_configs_test.py
+++ b/scripts/slave/unittests/recipe_configs_test.py
@@ -25,6 +25,7 @@ import test_env # pylint: disable=W0611,F0401
from slave import recipe_loader
from slave import recipe_util
+from slave import recipe_config_types
import coverage
@@ -100,7 +101,8 @@ def train_from_tests(args):
if configuration_results:
print 'Writing', file_name
with open(file_name, 'wb') as f:
- json.dump(configuration_results, f, sort_keys=True, indent=2)
+ json.dump(configuration_results, f, sort_keys=True, indent=2,
+ default=recipe_config_types.json_fixup)
else:
print 'Empty', file_name
@@ -131,6 +133,9 @@ def load_tests(loader, _standard_tests, _pattern):
def add_test_methods(cls):
for name, result in configuration_results.iteritems():
def add_test(name, result, expected_result):
+ # Roundtrip json to get same string encoding as load
+ result = json.loads(
+ json.dumps(result, default=recipe_config_types.json_fixup))
def test_(self):
self.assertEqual(result, expected_result)
test_.__name__ += name
« no previous file with comments | « scripts/slave/recipes/polymer.py ('k') | scripts/slave/unittests/recipes_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698