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

Unified Diff: scripts/slave/unittests/recipes_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/unittests/recipe_configs_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/recipes_test.py
diff --git a/scripts/slave/unittests/recipes_test.py b/scripts/slave/unittests/recipes_test.py
index eec7801c26b12ba477d160a40b07adbed7c11ab6..5a319a569683f7877044a7e965534ef5407395dd 100755
--- a/scripts/slave/unittests/recipes_test.py
+++ b/scripts/slave/unittests/recipes_test.py
@@ -52,6 +52,7 @@ import unittest
from common import annotator
from slave import recipe_util
+from slave import recipe_config_types
from slave import annotated_run
from slave import recipe_loader
@@ -114,6 +115,7 @@ def execute_test_case(test_data, recipe_path, recipe_name):
return recipe_loader.CreateRecipeApi(test_data=test_data, *args, **kwargs)
with cover():
+ recipe_config_types.ResetTostringFns()
step_data = annotated_run.run_steps(
stream, props, props, api, test_data).steps_ran.values()
return [s.step for s in step_data]
@@ -131,7 +133,8 @@ def train_from_tests((recipe_path, recipe_name)):
expected_path = expected_for(recipe_path, test_data.name)
print 'Writing', expected_path
with open(expected_path, 'wb') as f:
- json.dump(steps, f, sort_keys=True, indent=2, separators=(',', ': '))
+ json.dump(steps, f, sort_keys=True, indent=2, separators=(',', ': '),
+ default=recipe_config_types.json_fixup)
return True
@@ -148,7 +151,8 @@ def load_tests(loader, _standard_tests, _pattern):
def test_(self):
steps = execute_test_case(test_data, recipe_path, recipe_name)
# Roundtrip json to get same string encoding as load
- steps = json.loads(json.dumps(steps))
+ steps = json.loads(
+ json.dumps(steps, default=recipe_config_types.json_fixup))
with open(expected_path, 'rb') as f:
expected = json.load(f)
self.assertEqual(steps, expected)
« no previous file with comments | « scripts/slave/unittests/recipe_configs_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698