-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_settings.py
More file actions
33 lines (24 loc) · 936 Bytes
/
Copy pathtest_settings.py
File metadata and controls
33 lines (24 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import pytest
from ui_here.settings_here import (
SettingsHere,
ShowPolicySettingButton,
StartServerSettingButton,
)
def test_build_settings_password_type_added():
settings = SettingsHere()
assert "password" in settings._types
def test_can_navigate_to_privacy_policy(mocker):
webbrowser = mocker.patch("webbrowser.open")
settings = SettingsHere()
for uid in settings.interface.content.panels.keys():
settings.interface.content.current_uid = uid
for widget in settings.interface.content.walk():
if isinstance(widget, ShowPolicySettingButton):
widget.on_release()
webbrowser.assert_called_once()
@pytest.mark.asyncio
async def test_server_settings_button_popup_shown(app_instance):
button = StartServerSettingButton()
button.on_release()
popup = app_instance._app_window.children[0]
assert popup.title == "Server is already started"