Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test - Verify the application is running #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ _pycache_/

# Python
*.pyc
.cache
*.orig
*.pyc.*
/.cache
4 changes: 4 additions & 0 deletions edison/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ class ProductionConfig(Config):
class DevelopmentConfig(Config):
ENV_KEYWORD = "development"
DEBUG = True

class TestConfig(Config):
ENV_KEYWORD = "test"
TESTING = True
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Flask==1.1.1
flask-sqlalchemy==2.4.1
psycopg2-binary==2.8.5
pytest==3.3.2
12 changes: 12 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest
import sys, os

# Making edison module visible from tests folder.
sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/.."))

from edison.app import app

@pytest.fixture(scope='module')
def client():
with app.test_client() as client:
yield client
11 changes: 0 additions & 11 deletions tests/init_test.py

This file was deleted.

2 changes: 2 additions & 0 deletions tests/test_app_running.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_app_running(client):
assert client.get('/').status_code == 200