Skip to content

Commit

Permalink
Merge branch '200-secure-connection' of https://github.com/zincware/z…
Browse files Browse the repository at this point in the history
…ndraw into 200-secure-connection
  • Loading branch information
PythonFZ committed Oct 18, 2023
2 parents eb7e7e5 + 078ca8f commit e77f299
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
def water() -> ase.Atoms:
return ase.build.molecule("H2O")


@pytest.fixture
def ase_s22() -> list[ase.Atoms]:
return list(ase.collections.s22)
return list(ase.collections.s22)
7 changes: 6 additions & 1 deletion tests/test_zndraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# response = client.app.get("/")
# assert b"<h2>Hello, World!</h2>" in response.data

import numpy.testing as npt
import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import numpy.testing as npt

from zndraw import ZnDraw

Expand All @@ -24,6 +24,7 @@ def vis() -> ZnDraw:
yield visualizer
visualizer.close()


@pytest.mark.chrome
def test_gui_running(water):
vis = ZnDraw(token="test_token")
Expand All @@ -33,6 +34,7 @@ def test_gui_running(water):
assert "ZnDraw" in driver.title
vis.close()


@pytest.mark.chrome
def test_vis_atoms(vis, water):
vis[0] = water
Expand All @@ -41,12 +43,14 @@ def test_vis_atoms(vis, water):

assert vis.step == 0


@pytest.mark.chrome
def test_vis_selection(vis, water):
vis[0] = water
vis.selection = [1, 2]
assert vis.selection == [1, 2]


@pytest.mark.parametrize("display_new", [True, False])
@pytest.mark.chrome
def test_vis_step(vis, ase_s22, display_new):
Expand All @@ -61,6 +65,7 @@ def test_vis_step(vis, ase_s22, display_new):
vis.step = 10
assert vis.step == 10


@pytest.mark.chrome
def test_vis_points(vis, water):
vis[0] = water
Expand Down

0 comments on commit e77f299

Please sign in to comment.