Added tox testrunner

This commit is contained in:
Alen Mujezinovic 2013-01-16 13:26:07 +00:00
parent 039117b1f1
commit 2359c4e18f
8 changed files with 134 additions and 6 deletions

View File

@ -1,10 +1,14 @@
language: python
env:
- DJANGO="django==1.3.5"
- DJANGO="django==1.4.3"
- DJANGO=https://github.com/django/django/zipball/master
python:
- "2.6"
- "2.7"
# command to install dependencies
install:
- pip install -r requirements.txt --use-mirrors
install:
- pip install -q $DJANGO --use-mirrors
- pip install -q -r requirements.txt --use-mirrors
- python setup.py develop
script: python example/manage.py test provider oauth2 -v2
script: tests/test.sh

View File

@ -1 +0,0 @@
Django>=1.3

View File

@ -11,7 +11,7 @@ setup(
author='Alen Mujezinovic',
author_email='alen@caffeinehit.com',
url = 'https://github.com/caffeinehit/django-oauth2-provider',
packages= find_packages(),
packages= find_packages(exclude=('tests*',)),
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',

0
tests/__init__.py Normal file
View File

62
tests/settings.py Normal file
View File

@ -0,0 +1,62 @@
# Django settings for example project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Tester', 'test@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '%s/db.sqlite' % os.path.dirname(__file__), # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
SITE_ID = 1
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'secret'
ROOT_URLCONF = 'tests.urls'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'provider',
'provider.oauth2',
)

5
tests/test.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
export PYTHONPATH=$PWD/../:$PYTHONPATH
django-admin.py test provider oauth2 --settings tests.settings

9
tests/urls.py Normal file
View File

@ -0,0 +1,9 @@
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^oauth2/', include('provider.oauth2.urls', namespace = 'oauth2')),
)

49
tox.ini Normal file
View File

@ -0,0 +1,49 @@
[tox]
downloadcache = {toxworkdir}/cache/
envlist = py2.7-django1.5,py2.7-django1.4,py2.7-django1.3,py2.6-django1.5,py2.6-django1.4,py2.6-django1.3
[testenv]
commands =
pip install -q -r requirements.txt --use-mirrors
{toxinidir}/tests/test.sh
deps =
[testenv:py2.7-django1.5]
basepython = python2.7
deps = https://github.com/django/django/zipball/master
{[testenv]deps}
[testenv:py2.7-django1.4]
basepython = python2.7
deps = django==1.4.3
{[testenv]deps}
[testenv:py2.7-django1.3]
basepython = python2.7
deps = django==1.3.5
{[testenv]deps}
[testenv:py2.7-django1.2]
basepython = python2.7
deps = django==1.2.7
{[testenv]deps}
[testenv:py2.6-django1.5]
basepython = python2.6
deps = https://github.com/django/django/zipball/master
{[testenv]deps}
[testenv:py2.6-django1.4]
basepython = python2.6
deps = django==1.4.3
{[testenv]deps}
[testenv:py2.6-django1.3]
basepython = python2.6
deps = django==1.3.5
{[testenv]deps}
[testenv:py2.6-django1.2]
basepython = python2.6
deps = django==1.2.7
{[testenv]deps}