Skip to content

Commit 5b18689

Browse files
committed
reactivate commented out basic tests
test_hello_scientist() test_hello_structure()
1 parent 5b58080 commit 5b18689

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

crystal_toolkit/apps/examples/tests/test_bandstructure.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ def test_bs(dash_duo):
2626
# time.sleep(3)
2727
# dash_duo.percy_snapshot("example_bsdos_projection_index_2")
2828

29-
assert (
30-
bool(dash_duo.get_logs()) is False
31-
), f"Browser console contains an error: {dash_duo.get_logs()}"
29+
logs = dash_duo.get_logs()
30+
assert logs == [], f"Browser console should not contain errors: {logs}"
Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
import time
22

3+
from crystal_toolkit.apps.examples.basic_hello_structure import (
4+
app as hello_structure_app,
5+
)
36
from crystal_toolkit.apps.examples.basic_hello_structure_interactive import (
47
app as hello_structure_interactive_app,
58
)
9+
from crystal_toolkit.apps.examples.basic_hello_world import app as hello_world_app
610

7-
#
8-
# def test_hello_scientist(dash_duo):
9-
#
10-
# dash_duo.start_server(hello_world_app)
11-
# dash_duo.clear_storage()
12-
#
13-
# time.sleep(1)
14-
# dash_duo.percy_snapshot("hello_scientist")
15-
#
16-
# logs = dash_duo.get_logs()
17-
# assert bool(logs) is False, f"Browser console contains an error: {logs}"
18-
#
19-
#
20-
# def test_hello_structure(dash_duo):
21-
# dash_duo.start_server(hello_structure_app)
22-
# dash_duo.clear_storage()
23-
#
24-
# time.sleep(1)
25-
# dash_duo.percy_snapshot("hello_structure")
26-
#
27-
# logs = dash_duo.get_logs()
28-
# assert bool(logs) is False, f"Browser console contains an error: {logs}"
29-
30-
31-
def test_hello_structure_interactive(dash_duo):
32-
dash_duo.start_server(hello_structure_interactive_app)
11+
from .typing import DashDuo
12+
13+
14+
def test_hello_scientist(dash_duo: DashDuo):
15+
16+
dash_duo.start_server(hello_world_app)
17+
dash_duo.clear_storage()
18+
19+
dash_duo.percy_snapshot("hello_scientist")
20+
21+
logs = dash_duo.get_logs()
22+
assert bool(logs) is False, f"Browser console contains an error: {logs}"
23+
24+
25+
def test_hello_structure(dash_duo):
26+
dash_duo.start_server(hello_structure_app)
3327
dash_duo.clear_storage()
3428

3529
time.sleep(1)
30+
dash_duo.percy_snapshot("hello_structure")
31+
32+
logs = dash_duo.get_logs()
33+
assert bool(logs) is False, f"Browser console contains an error: {logs}"
34+
35+
36+
def test_hello_structure_interactive(dash_duo: DashDuo) -> None:
37+
dash_duo.start_server(hello_structure_interactive_app)
38+
dash_duo.clear_storage()
39+
3640
dash_duo.percy_snapshot("hello_structure_interactive_on_load")
3741

3842
dash_duo.multiple_click("#change_structure_button", 1)
3943

40-
time.sleep(1)
4144
dash_duo.percy_snapshot("hello_structure_interactive_on_click")
4245

4346
logs = dash_duo.get_logs()
44-
assert bool(logs) is False, f"Browser console contains an error: {logs}"
47+
assert logs == [], f"Browser console should not contain errors: {logs}"

crystal_toolkit/apps/tests/test_main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import time
22

3+
from crystal_toolkit.apps.examples.tests.typing import DashDuo
34
from crystal_toolkit.apps.main import app
45

56

6-
def test_main_app_startup(dash_duo):
7+
def test_main_app_startup(dash_duo: DashDuo):
78

89
dash_duo.start_server(app)
910
# dash_duo.clear_storage()

0 commit comments

Comments
 (0)