From 6b895c49e3cfd0ae4e72ceff01e84b2a48ff60b8 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Wed, 26 Jul 2023 11:55:47 +0200 Subject: [PATCH] Update tests and fix formating --- openandroidinstaller/openandroidinstaller.py | 8 ++++---- openandroidinstaller/tooling.py | 2 ++ tests/test_app.py | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/openandroidinstaller/openandroidinstaller.py b/openandroidinstaller/openandroidinstaller.py index db668a96..8c5e83b4 100644 --- a/openandroidinstaller/openandroidinstaller.py +++ b/openandroidinstaller/openandroidinstaller.py @@ -230,13 +230,13 @@ def main(page: Page, test: bool = False, test_config: str = "sargo"): # header page.appbar = AppBar( - leading=Image( - src="/logo-192x192.png", height=40, width=40, border_radius=40 - ), + leading=Image(src="/logo-192x192.png", height=40, width=40, border_radius=40), leading_width=56, toolbar_height=72, elevation=0, - title=Text(f"OpenAndroidInstaller version {VERSION}"), #, style="displaySmall"), + title=Text( + f"OpenAndroidInstaller version {VERSION}" + ), # , style="displaySmall"), center_title=False, bgcolor="#00d886", actions=[ diff --git a/openandroidinstaller/tooling.py b/openandroidinstaller/tooling.py index c0640f83..d3a551be 100644 --- a/openandroidinstaller/tooling.py +++ b/openandroidinstaller/tooling.py @@ -368,12 +368,14 @@ def fastboot_unlock(bin_path: Path) -> TerminalResponse: for line in run_command("fastboot flashing unlock", bin_path): yield line + @add_logging("Critically unlocking the device with fastboot without code.") def fastboot_unlock_critical(bin_path: Path) -> TerminalResponse: """Unlock critical the device with fastboot and without code.""" for line in run_command("fastboot flashing unlock_critical", bin_path): yield line + @add_logging("OEM unlocking the device with fastboot.") def fastboot_oem_unlock(bin_path: Path) -> TerminalResponse: """OEM unlock the device with fastboot and without code.""" diff --git a/tests/test_app.py b/tests/test_app.py index cb11a16e..52d60979 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -46,7 +46,12 @@ def test_app_sargo(): number_of_steps = 14 for _ in range(number_of_steps): page.controls[0].to_next_view(None) - assert "SuccessView" in str(page.controls[0].view.controls[0]) + assert "Installation completed successfully!" in str( + page.controls[0] + .view.controls[0] + .right_view_header.controls[0] + .content.controls[0] + ) def test_app_beyond2lte(): @@ -61,4 +66,9 @@ def test_app_beyond2lte(): number_of_steps = 14 for _ in range(number_of_steps): page.controls[0].to_next_view(None) - assert "SuccessView" in str(page.controls[0].view.controls[0]) + assert "Installation completed successfully!" in str( + page.controls[0] + .view.controls[0] + .right_view_header.controls[0] + .content.controls[0] + )