commit | 2fc563180f724d0c54b74f62ff77f970700ef44d | [log] [tgz] |
---|---|---|
author | Xianyuan Jia <xianyuanjia@google.com> | Mon Aug 05 12:05:31 2019 -0700 |
committer | Xianyuan Jia <xianyuanjia@google.com> | Mon Aug 05 19:12:25 2019 +0000 |
tree | 686946fce276d6c49ea5dcc568d4833d726bcd74 | |
parent | d31ae4d2b42c21fba374955994910fc1f2b5b063 [diff] [blame] |
Allow DeviceState to accept base_cmd as a formattable string Bug: 130375017 Test: unit tests Change-Id: Ifeaab18541c1b45e7b04672843a0fd43a4c54c87
diff --git a/acts/framework/acts/test_utils/instrumentation/adb_command_types.py b/acts/framework/acts/test_utils/instrumentation/adb_command_types.py index fe1b7ce..5c55734 100644 --- a/acts/framework/acts/test_utils/instrumentation/adb_command_types.py +++ b/acts/framework/acts/test_utils/instrumentation/adb_command_types.py
@@ -37,9 +37,11 @@ Args: values: The value(s) to run the command with """ - - return str.strip(' '.join( - [self._base_cmd] + [str(value) for value in values])) + try: + return self._base_cmd % values + except TypeError: + return str.strip(' '.join( + [self._base_cmd] + [str(value) for value in values])) def toggle(self, enabled): """Returns the command corresponding to the desired state.