Skip to content

Commit

Permalink
Improves doc for adb_call_parser_test.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 644426633
  • Loading branch information
DeepMind authored and copybara-github committed Jun 18, 2024
1 parent 48d1d31 commit 89b0c79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions android_env/components/adb_call_parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class AdbCallParserTest(parameterized.TestCase):

def test_unknown_command(self):
"""Gets UNKNOWN_COMMAND for an empty request."""
adb = mock.create_autospec(adb_controller.AdbController)
parser = adb_call_parser.AdbCallParser(
adb, tmp_dir=self.create_tempdir().full_path
Expand All @@ -58,6 +59,7 @@ def test_invalid_timeout(self):

@mock.patch.object(os.path, 'exists', autospec=True)
def test_install_apk_file_not_found(self, mock_exists):
"""Should fail installing APK when it is not found."""
adb = mock.create_autospec(adb_controller.AdbController)
parser = adb_call_parser.AdbCallParser(
adb, tmp_dir=self.create_tempdir().full_path
Expand All @@ -73,6 +75,7 @@ def test_install_apk_file_not_found(self, mock_exists):

@mock.patch.object(os.path, 'exists', autospec=True)
def test_install_apk_successful(self, mock_exists):
"""Should succeed installing an arbitrary APK."""
adb = mock.create_autospec(adb_controller.AdbController)
parser = adb_call_parser.AdbCallParser(
adb, tmp_dir=self.create_tempdir().full_path
Expand All @@ -89,6 +92,7 @@ def test_install_apk_successful(self, mock_exists):

@mock.patch.object(tempfile, 'NamedTemporaryFile', autospec=True)
def test_install_apk_from_blob(self, mock_tempfile):
"""Should succeed installing APK from blob."""
adb = mock.create_autospec(adb_controller.AdbController)
tmp_dir = self.create_tempdir().full_path
parser = adb_call_parser.AdbCallParser(adb, tmp_dir=tmp_dir)
Expand All @@ -114,6 +118,7 @@ def test_install_apk_from_blob(self, mock_tempfile):
# pytype: enable=attribute-error

def test_start_activity_empty_full_activity(self):
"""A start_activity command should always have a nonempty activity."""
adb = mock.create_autospec(adb_controller.AdbController)
parser = adb_call_parser.AdbCallParser(
adb, tmp_dir=self.create_tempdir().full_path
Expand Down

0 comments on commit 89b0c79

Please sign in to comment.