summaryrefslogtreecommitdiffstats
path: root/tools/isolate/trace_inputs_test.py
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 00:39:03 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 00:39:03 +0000
commitfa7147c596518cdf5973638de491f51fccfe4d6d (patch)
tree265e4483461d94f38b85da746fb6691c97540c95 /tools/isolate/trace_inputs_test.py
parentf9b3061d04621360775cfa08a4c9e18f5452307e (diff)
downloadchromium_src-fa7147c596518cdf5973638de491f51fccfe4d6d.zip
chromium_src-fa7147c596518cdf5973638de491f51fccfe4d6d.tar.gz
chromium_src-fa7147c596518cdf5973638de491f51fccfe4d6d.tar.bz2
Add variable replacement in trace_inputs.py
Do not add it to isolate.py yet. NOTRY=true R=cmp@chromium.org BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10542087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/isolate/trace_inputs_test.py')
-rwxr-xr-xtools/isolate/trace_inputs_test.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/isolate/trace_inputs_test.py b/tools/isolate/trace_inputs_test.py
index d95be16..89c33b4 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."""