Catch AndroidTV exception on setup (#86819)

fixes undefined
This commit is contained in:
ollo69 2023-01-30 22:42:32 +01:00 committed by GitHub
parent 8337d4613e
commit 772df02cce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 30 deletions

View file

@ -111,7 +111,7 @@ def patch_connect(success):
}
def patch_shell(response=None, error=False, mac_eth=False):
def patch_shell(response=None, error=False, mac_eth=False, exc=None):
"""Mock the `AdbDeviceTcpAsyncFake.shell` and `DeviceAsyncFake.shell` methods."""
async def shell_success(self, cmd, *args, **kwargs):
@ -128,7 +128,7 @@ def patch_shell(response=None, error=False, mac_eth=False):
async def shell_fail_python(self, cmd, *args, **kwargs):
"""Mock the `AdbDeviceTcpAsyncFake.shell` method when it fails."""
self.shell_cmd = cmd
raise ValueError
raise exc or ValueError
async def shell_fail_server(self, cmd):
"""Mock the `DeviceAsyncFake.shell` method when it fails."""