diff --git a/android_env/components/adb_call_parser_test.py b/android_env/components/adb_call_parser_test.py index 33b41dd..c3f4cfb 100644 --- a/android_env/components/adb_call_parser_test.py +++ b/android_env/components/adb_call_parser_test.py @@ -25,6 +25,7 @@ from android_env.components import adb_call_parser from android_env.components import adb_controller from android_env.proto import adb_pb2 +from google.protobuf import text_format class AdbCallParserTest(parameterized.TestCase): @@ -229,8 +230,9 @@ def test_grant_permissions_successful(self): def test_press_button_invalid_button(self): adb = mock.create_autospec(adb_controller.AdbController) parser = adb_call_parser.AdbCallParser(adb) - request = adb_pb2.AdbRequest() - request.press_button.button = 99999 # pyrefly: ignore[bad-assignment] + request = text_format.Parse( + 'press_button { button: 99999 }', adb_pb2.AdbRequest() + ) response = parser.parse(request) self.assertEqual(response.status, adb_pb2.AdbResponse.Status.FAILED_PRECONDITION)