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

Unified Diff: tools/telemetry/telemetry/core/backends/android_command_line_backend_unittest.py

Issue 811703007: Create AndroidCommandLineBackend to handle setting up cmdline args (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add context manager for command line backend Created 5 years, 11 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/telemetry/core/backends/android_command_line_backend_unittest.py
diff --git a/tools/telemetry/telemetry/core/backends/android_command_line_backend_unittest.py b/tools/telemetry/telemetry/core/backends/android_command_line_backend_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..4e7b5294dfa655e237dd239bdaed50e919e701a9
--- /dev/null
+++ b/tools/telemetry/telemetry/core/backends/android_command_line_backend_unittest.py
@@ -0,0 +1,31 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+
+from telemetry.core.backends import android_command_line_backend
+
+
+class AndroidCommandLineBackendTest(unittest.TestCase):
+
+ def testQuoteIfNeededNoEquals(self):
+ string = 'value'
+ self.assertEqual(string,
+ android_command_line_backend._QuoteIfNeeded(string))
+
+ def testQuoteIfNeededNoSpaces(self):
+ string = 'key=valueA'
+ self.assertEqual(string,
+ android_command_line_backend._QuoteIfNeeded(string))
+
+ def testQuoteIfNeededAlreadyQuoted(self):
+ string = "key='valueA valueB'"
+ self.assertEqual(string,
+ android_command_line_backend._QuoteIfNeeded(string))
+
+ def testQuoteIfNeeded(self):
+ string = 'key=valueA valueB'
+ expected_output = "key='valueA valueB'"
+ self.assertEqual(expected_output,
+ android_command_line_backend._QuoteIfNeeded(string))

Powered by Google App Engine
This is Rietveld 408576698