Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Make inside_gratipay a proper local package
Browse files Browse the repository at this point in the history
Besides being more generally organized, this makes it easier to import
.main.website into the test suite.
  • Loading branch information
chadwhitacre committed Dec 5, 2016
1 parent 3d10ed1 commit 5221163
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env: requirements.txt requirements_tests.txt
./$(env_bin)/pip --version
./$(env_bin)/pip install --no-index --find-links=file:///$(PWD)/vendor -r requirements.txt
./$(env_bin)/pip install --no-index --find-links=file:///$(PWD)/vendor -r requirements_tests.txt
./$(env_bin)/pip install --editable .

clean:
rm -rf env
Expand Down
Empty file added inside_gratipay/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions inside_gratipay.py → inside_gratipay/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
from aspen import Response
from aspen.website import Website

import canonizer
import gfm
from nav import NavItem
from . import canonizer, gfm
from .nav import NavItem


website = Website(www_root='www', project_root='.')
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ honcho==0.5.0

six==1.10.0
libsass==0.3.0

-e .
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup, find_packages

setup(name='inside_gratipay', packages=find_packages())
2 changes: 1 addition & 1 deletion startapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# by WSGI convention, we need to create webapp object
# and by default most WSGI servers look for 'application'
from inside_gratipay import website as application
from inside_gratipay.main import website as application

if __name__ == '__main__':
from wsgiref.simple_server import make_server
Expand Down
5 changes: 4 additions & 1 deletion tests/py/test_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
from pytest import yield_fixture

from aspen.testing.client import Client
from inside_gratipay.main import website

@yield_fixture
def client():
yield Client(www_root='www', project_root='')
client = Client(www_root='www', project_root='.')
client._website = website
yield client

def test_disallowed_methods(client):
for disallowed in ['TRACE', 'trAce', 'DELETE', 'PUT', 'OPTIONS', 'JUNK']:
Expand Down

0 comments on commit 5221163

Please sign in to comment.