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

Unified Diff: tools/isolate/trace_inputs_test.py

Issue 10542087: Add variable replacement in trace_inputs.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « tools/isolate/trace_inputs.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/isolate/trace_inputs_test.py
diff --git a/tools/isolate/trace_inputs_test.py b/tools/isolate/trace_inputs_test.py
index d95be163635252cb7453c2c5a6c54ba987f1db2b..89c33b42737a115c2d38606acd4777a8048f5ea8 100755
--- a/tools/isolate/trace_inputs_test.py
+++ b/tools/isolate/trace_inputs_test.py
@@ -25,6 +25,20 @@ class TraceInputs(unittest.TestCase):
for actual, expected in test_cases:
self.assertEquals(expected, trace_inputs.process_quoted_arguments(actual))
+ def test_variable_abs(self):
+ value = trace_inputs.Results.File(None, '/foo/bar', False)
+ actual = value.replace_variables({'$FOO': '/foo'})
+ self.assertEquals('$FOO/bar', actual.path)
+ self.assertEquals('$FOO/bar', actual.full_path)
+ self.assertEquals(True, actual.tainted)
+
+ def test_variable_rel(self):
+ value = trace_inputs.Results.File('/usr', 'foo/bar', False)
+ actual = value.replace_variables({'$FOO': 'foo'})
+ self.assertEquals('$FOO/bar', actual.path)
+ self.assertEquals(os.path.join('/usr', '$FOO/bar'), actual.full_path)
+ self.assertEquals(True, actual.tainted)
+
def join_norm(*args):
"""Joins and normalizes path in a single step."""
« no previous file with comments | « tools/isolate/trace_inputs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698