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

Unified Diff: tools/telemetry/third_party/gsutilz/gslib/tests/test_trace.py

Issue 1376593003: Roll gsutil version to 4.15. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: tools/telemetry/third_party/gsutilz/gslib/tests/test_trace.py
diff --git a/tools/telemetry/third_party/gsutilz/gslib/tests/test_trace.py b/tools/telemetry/third_party/gsutilz/gslib/tests/test_trace.py
new file mode 100644
index 0000000000000000000000000000000000000000..673b0cf2f11cacc70db7060a2db5fbf3bded844a
--- /dev/null
+++ b/tools/telemetry/third_party/gsutilz/gslib/tests/test_trace.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+# Copyright 2015 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Integration tests for gsutil --trace-token option."""
+
+from __future__ import absolute_import
+
+from gslib.cs_api_map import ApiSelector
+import gslib.tests.testcase as testcase
+from gslib.tests.testcase.integration_testcase import SkipForS3
+from gslib.tests.util import ObjectToURI as suri
+
+
+@SkipForS3('--trace-token is supported only on GCS JSON API.')
+class TestTraceTokenOption(testcase.GsUtilIntegrationTestCase):
+ """Integration tests for gsutil --trace-token option."""
+
+ def test_minus_tracetoken_cat(self):
+ """Tests cat command with trace-token option."""
+ key_uri = self.CreateObject(contents='0123456789')
+ (_, stderr) = self.RunGsUtil(
+ ['-D', '--trace-token=THISISATOKEN', 'cat', suri(key_uri)],
+ return_stdout=True, return_stderr=True)
+ if self.test_api == ApiSelector.JSON:
+ self.assertIn('You are running gsutil with trace output enabled.', stderr)
+ self.assertRegexpMatches(
+ stderr, r'.*GET.*b/%s/o/%s\?.*&trace=token%%3ATHISISATOKEN' %
+ (key_uri.bucket_name, key_uri.object_name))

Powered by Google App Engine
This is Rietveld 408576698