32 lines
686 B
Python
32 lines
686 B
Python
import flet as ft
|
|
|
|
from app.main import main
|
|
|
|
|
|
class FakePage:
|
|
platform = ft.PagePlatform.LINUX
|
|
|
|
def add(self, *controls: ft.Control) -> None:
|
|
self.controls = controls
|
|
|
|
def update(self) -> None:
|
|
pass
|
|
|
|
def open(self, control: ft.Control) -> None:
|
|
pass
|
|
|
|
def close(self, control: ft.Control) -> None:
|
|
pass
|
|
|
|
def launch_url(self, url: str) -> None:
|
|
pass
|
|
|
|
def run_task(self, handler) -> None:
|
|
pass
|
|
|
|
|
|
def test_ui_control_tree_builds_with_current_flet_api() -> None:
|
|
page = FakePage()
|
|
main(page) # type: ignore[arg-type]
|
|
assert len(page.controls) == 1
|
|
assert isinstance(page.controls[0], ft.SafeArea)
|