mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 07:13:55 +02:00
build first set of docker container in pipline and place them in the the github registry (#142)
- added a Dockerfile for the thre containers - added a workflow step to build and placing the container in the registry - added a docker-compose.yaml to use the build images - added a docker compose to build the images locally and a script for prebuild steps
This commit is contained in:
26
tests/ui/protection_test.py
Normal file
26
tests/ui/protection_test.py
Normal file
@ -0,0 +1,26 @@
|
||||
"""Tests the addition of an authentication framework."""
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
from dash import Dash
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
from aki_prj23_transparenzregister.ui import protection
|
||||
|
||||
|
||||
def test_no_auth(monkeypatch: MonkeyPatch, mocker: MockerFixture) -> None:
|
||||
"""Tests if no authentication is added."""
|
||||
monkeypatch.setenv("PYTHON_DASH_LOGIN_USERNAME", "")
|
||||
monkeypatch.setenv("PYTHON_DASH_LOGIN_PW", "")
|
||||
|
||||
basic_auth_mocker = mocker.spy(protection.dash_auth, "BasicAuth")
|
||||
protection.add_auth(Dash())
|
||||
basic_auth_mocker.assert_not_called()
|
||||
|
||||
|
||||
def test_add_auth(monkeypatch: MonkeyPatch, mocker: MockerFixture) -> None:
|
||||
"""Tests if an authentication is added."""
|
||||
monkeypatch.setenv("PYTHON_DASH_LOGIN_USERNAME", "some-login")
|
||||
monkeypatch.setenv("PYTHON_DASH_LOGIN_PW", "some-pw")
|
||||
|
||||
basic_auth_mocker = mocker.spy(protection.dash_auth, "BasicAuth")
|
||||
protection.add_auth(Dash())
|
||||
basic_auth_mocker.assert_called_once()
|
Reference in New Issue
Block a user