add some tests

This commit is contained in:
Matthew Scragg 2014-10-06 16:07:20 -05:00
parent cc7fa1b433
commit 8a4cda7f58
6 changed files with 15 additions and 11 deletions

View file

@ -6,6 +6,6 @@ python:
before_install: before_install:
- sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libyaml-dev libssl-dev - sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libyaml-dev libssl-dev
install: install: "pip install -r dev-requirements"
- "python setup.py install"
script: nosetests

3
dev-requirements.txt Normal file
View file

@ -0,0 +1,3 @@
-r requirements.txt
Flask-Testing==0.4.2
nose==1.3.4

View file

@ -21,9 +21,9 @@ sudo apt-get update
sudo apt-get install -y software-properties-common python-software-properties sudo apt-get install -y software-properties-common python-software-properties
sudo add-apt-repository -y ppa:chris-lea/node.js sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update sudo apt-get update
sudo apt-get install -y python build-essential git libpcre3-dev \ sudo apt-get install -y python build-essential pkg-config git \
python-pip python-virtualenv python-dev pkg-config curl libxml2-dev libxslt1-dev zlib1g-dev \ python-pip python-virtualenv python-dev libxml2-dev libxslt1-dev zlib1g-dev \
libffi-dev nodejs libyaml-dev libssl-dev libffi-dev libyaml-dev libssl-dev nodejs
# Default cache is memoization # Default cache is memoization

View file

@ -4,7 +4,6 @@ from realms.lib.util import random_string
from subprocess import call from subprocess import call
import click import click
import json import json
import sys
@cli.command() @cli.command()
@ -85,6 +84,7 @@ def setup_redis(**kw):
def get_pip(): def get_pip():
""" Get virtualenv path for pip """ Get virtualenv path for pip
""" """
import sys
return sys.prefix + '/bin/pip' return sys.prefix + '/bin/pip'

View file

@ -1,10 +1,12 @@
import sys
if 'threading' in sys.modules:
del sys.modules['threading']
# Monkey patch stdlib. # Monkey patch stdlib.
import gevent.monkey import gevent.monkey
gevent.monkey.patch_all(aggressive=False, subprocess=True) gevent.monkey.patch_all(aggressive=False, subprocess=True)
# Set default encoding to UTF-8 # Set default encoding to UTF-8
import sys
reload(sys) reload(sys)
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
sys.setdefaultencoding('utf-8') sys.setdefaultencoding('utf-8')

View file

@ -16,11 +16,10 @@
</form> </form>
</div> </div>
{% endif %} {% endif %}
<div id="page-content" style="display:none"> <div id="page-content"></div>
{{ page.data }}
</div>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script> <script>
$(function(){ $(function(){