beer/tests/test_beer.py
kleph 9b34a898a3
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
[tests] Add unit tests with pytest
2020-02-25 01:07:38 +01:00

23 lines
457 B
Python

# pylint: disable=no-name-in-module, redefined-outer-name
""" Unit tests """
import pytest
from beer import beer
@pytest.fixture
def client():
""" create flask app """
beer.app.config['TESTING'] = True
with beer.app.test_client() as client:
yield client
def test_slash(client):
"""Test wiwth no param"""
response = client.get('/')
assert response.status_code == 200
assert b'<title>beer</title>' in response.data