-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop publishing INSTALL.txt on PyPI because it's very misleading at this point. Remove zope.app.testing and zope.app.zcmlfiles dependencies. Test coverage could be better.
- Loading branch information
Showing
34 changed files
with
401 additions
and
186 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,8 @@ | ||
[run] | ||
source = src | ||
|
||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
if __name__ == '__main__': | ||
raise NotImplementedError |
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ build/ | |
dist/ | ||
*.egg-info/ | ||
.tox/ | ||
.coverage | ||
htmlcov/ |
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,9 +1,26 @@ | ||
language: python | ||
sudo: false | ||
python: | ||
- 2.7 | ||
install: | ||
- pip install . | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
- pypy-5.4.1 | ||
script: | ||
- python setup.py test -q | ||
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress | ||
|
||
after_success: | ||
- coveralls | ||
notifications: | ||
email: false | ||
email: false | ||
|
||
install: | ||
- pip install -U pip setuptools | ||
- pip install -U coveralls coverage | ||
- pip install -U -e ".[test]" | ||
|
||
|
||
cache: pip | ||
|
||
before_cache: | ||
- rm -f $HOME/.cache/pip/log/debug.log |
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.
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,6 +1,10 @@ | ||
include *.py | ||
include *.txt | ||
include *.rst | ||
include buildout.cfg | ||
include tox.ini | ||
include .travis.yml | ||
include .coveragerc | ||
recursive-include src *.pt | ||
recursive-include src *.txt | ||
recursive-include src *.rst | ||
recursive-include src *.zcml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[bdist_wheel] | ||
universal = 1 |
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
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,7 +1 @@ | ||
# this is a namespace package | ||
try: | ||
import pkg_resources | ||
pkg_resources.declare_namespace(__name__) | ||
except ImportError: | ||
import pkgutil | ||
__path__ = pkgutil.extend_path(__path__, __name__) | ||
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover |
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,7 +1 @@ | ||
# this is a namespace package | ||
try: | ||
import pkg_resources | ||
pkg_resources.declare_namespace(__name__) | ||
except ImportError: | ||
import pkgutil | ||
__path__ = pkgutil.extend_path(__path__, __name__) | ||
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover |
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
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
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
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
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,2 +1,51 @@ | ||
# | ||
# This file is necessary to make this directory a package. | ||
import unittest | ||
from webtest import TestApp | ||
|
||
from zope.component import getUtility | ||
from zope.publisher.browser import BrowserView | ||
from zope.traversing.browser.absoluteurl import absoluteURL | ||
|
||
from zope.error.interfaces import IErrorReportingUtility | ||
|
||
|
||
from zope.app.applicationcontrol.testing import ApplicationControlLayer | ||
|
||
|
||
class BrowserTestCase(unittest.TestCase): | ||
|
||
layer = ApplicationControlLayer | ||
|
||
def setUp(self): | ||
super(BrowserTestCase, self).setUp() | ||
self._testapp = TestApp(self.layer.make_wsgi_app()) | ||
|
||
def publish(self, path, basic=None, form=None, headers=None): | ||
assert basic | ||
self._testapp.authorization = ('Basic', tuple(basic.split(':'))) | ||
|
||
env = {'wsgi.handleErrors': False} | ||
if form: | ||
response = self._testapp.post(path, params=form, | ||
extra_environ=env, headers=headers) | ||
else: | ||
response = self._testapp.get(path, extra_environ=env, headers=headers) | ||
return response | ||
|
||
class ErrorRedirect(BrowserView): | ||
# copied from zope.app.error | ||
def action(self): | ||
# Some locations (eg ++etc++process) throw a TypeError exception when | ||
# finding their absoluteurl, if this happens catch the error and | ||
# redirect the browser to the site root "/@@errorRedirect.html" | ||
# to handle redirection to the site error logger instead | ||
try: | ||
err = getUtility(IErrorReportingUtility) | ||
url = absoluteURL(err, self.request) | ||
except TypeError: | ||
url = self.request.getApplicationURL() + "/@@errorRedirect.html" | ||
else: | ||
# The real zope.app.error would redirect to | ||
# url + @@SelectedManagementView.html | ||
raise NotImplementedError() | ||
|
||
self.request.response.redirect(url) |
Oops, something went wrong.