Added the first test case

This commit is contained in:
Pünkösd Marcell 2020-11-29 03:15:11 +01:00
parent 1dd4e5eff3
commit 44139a4206
4 changed files with 27 additions and 0 deletions

3
pytest.ini Normal file
View File

@ -0,0 +1,3 @@
[pytest]
filterwarnings =
ignore:^Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working*:DeprecationWarning

1
requirements-dev.txt Normal file
View File

@ -0,0 +1 @@
pytest

5
src/tests/__init__.py Normal file
View File

@ -0,0 +1,5 @@
import os
os.environ['CAFF_PREVIEWER_ENDPOINT'] = ''
os.environ['MINIO_ENDPOINT'] = ''
os.environ['MINIO_ACCESS_KEY'] = ''
os.environ['MINIO_SECRET_KEY'] = ''

View File

@ -0,0 +1,18 @@
import pytest
import app
@pytest.fixture
def client():
app.app.config['TESTING'] = True
with app.app.test_client() as client:
yield client
def test_login_required(client):
r = client.get('/content/caff/1')
assert r.status_code == 302