Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
151 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
repo_token: hJJWJuaBh8mU4adgwkZLh8gGkQYIxRbbo | ||
service_name: travis-ci | ||
# parallel: true # if the CI is running your build in parallel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
language: python | ||
python: | ||
# - "2.7" | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
- "3.6" | ||
- "3.6-dev" # 3.6 development branch | ||
- "3.7-dev" # 3.7 development branch | ||
|
||
|
||
# command to install dependencies | ||
install: | ||
- pip install -r requirements.txt | ||
|
||
- pip install coveralls | ||
|
||
- coverage run tests.py | ||
|
||
script: | ||
- pytest tests.py # or py.test for Python versions 3.5 and below | ||
|
||
after_success: coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: gunicorn messenger:app --log-file=- | ||
web: gunicorn --chdir app/ messenger:app --log-file=- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
import pytest | ||
|
||
# add parent folders to system path to import classes to testing | ||
import sys | ||
sys.path.append('../') | ||
|
||
from test_conf import * | ||
|
||
|
||
|
||
# smoke tests | ||
class TestForSmoke(object): | ||
|
||
def test_something_basic(self): | ||
pass |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- coding: utf-8 -*- | ||
import pytest | ||
|
||
# add parent folders to system path to import classes to testing | ||
import sys | ||
sys.path.append('../app') | ||
|
||
from messenger import * | ||
from constants import * | ||
|
||
# from project import create_app, db | ||
# from project.models import User | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def new_user(): | ||
# user = User('patkennedy79@gmail.com', 'FlaskIsAwesome') | ||
return | ||
# return user | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def test_client(): | ||
# flask_app = create_app('flask_test.cfg') | ||
|
||
# # Flask provides a way to test your application by exposing the Werkzeug test Client | ||
# # and handling the context locals for you. | ||
# testing_client = flask_app.test_client() | ||
|
||
# # Establish an application context before running the tests. | ||
# ctx = flask_app.app_context() | ||
# ctx.push() | ||
|
||
# yield testing_client # this is where the testing happens! | ||
|
||
# ctx.pop() | ||
return | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def init_database(): | ||
# Create the database and the database table | ||
# db.create_all() | ||
|
||
# # Insert user data | ||
# user1 = User(email='patkennedy79@gmail.com', plaintext_password='FlaskIsAwesome') | ||
# user2 = User(email='kennedyfamilyrecipes@gmail.com', plaintext_password='PaSsWoRd') | ||
# db.session.add(user1) | ||
# db.session.add(user2) | ||
|
||
# # Commit the changes for the users | ||
# db.session.commit() | ||
|
||
# yield db # this is where the testing happens! | ||
|
||
# db.drop_all() | ||
return | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import pytest | ||
|
||
# add parent folders to system path to import classes to testing | ||
import sys | ||
sys.path.append('../') | ||
|
||
from test_conf import * | ||
|
||
|
||
|
||
# FIXME this shouldn't exist, we should have separate functions to do these things | ||
def return_response_object(text, quick_replies=None, buttons=None): | ||
ret_obj = {} | ||
ret_obj['text'] = text | ||
ret_obj['quick_replies'] = quick_replies | ||
ret_obj['buttons'] = buttons | ||
return ret_obj | ||
|
||
|
||
class TestBotResponses(object): | ||
|
||
def test_intro_message_response(self): | ||
reply = bot_response("Hello") | ||
response_obj = return_response_object("Hello! I’m Sloan, your automated guide for advice on your student loans brought to you by TISLA. This is not legal advice but simple guidance to help you manage your student loan debt. Send 'restart' at any time to restart. Ready? Simply type your question and I’ll try and guide you to the best way to manage your student debt!", raw_response_data['replies']['intro']) | ||
|
||
assert reply.get('text', None) == response_obj.get('text') | ||
assert reply.get('buttons', None) == response_obj.get('buttons') | ||
assert reply.get('quick_replies', None) == response_obj.get('quick_replies') |