-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaks dependency on zope.app.testing and zope.app.zcmlfiles and zope.app.component. - Replace all uses of assert_ with more specific method. - Append :list to appropriate parameter names to account for differences in zope.app.testing and zope.app.wsgi. - Use zope.testing.cleanup to tear down things like interactions, if needed.
- Loading branch information
Showing
19 changed files
with
590 additions
and
250 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,6 @@ | ||
[run] | ||
source = src | ||
|
||
[report] | ||
exclude_lines = | ||
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,9 +1,22 @@ | ||
language: python | ||
sudo: false | ||
python: | ||
- 2.7 | ||
- pypy-5.4.1 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
install: | ||
- pip install . | ||
- pip install -U pip setuptools | ||
- pip install -U coverage coveralls | ||
- pip install -e git+https://github.com/zopefoundation/zope.proxy.git@issue15#egg=zope.proxy | ||
- pip install -U -e .[test] | ||
script: | ||
- python setup.py test -q | ||
- coverage run -m zope.testrunner --test-path=src --auto-color --auto-progress | ||
notifications: | ||
email: false | ||
after_success: | ||
- coveralls | ||
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
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 |
---|---|---|
@@ -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
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,39 @@ | ||
# | ||
# This file is necessary to make this directory a package. | ||
|
||
import unittest | ||
|
||
from webtest import TestApp | ||
|
||
from zope import component | ||
|
||
def provideAdapter(required, provided, factory): | ||
gsm = component.getGlobalSiteManager() | ||
gsm.registerAdapter(factory, [required], provided, event=False) | ||
|
||
|
||
class BrowserTestCase(unittest.TestCase): | ||
|
||
def getRootFolder(self): | ||
return self.layer.getRootFolder() | ||
|
||
def setUp(self): | ||
super(BrowserTestCase, self).setUp() | ||
self._testapp = TestApp(self.layer.make_wsgi_app()) | ||
# Typically this would be done by zope.app.principalannotation's | ||
# bootstrap.zcml but we don't have a dep on that. | ||
from zope.principalannotation.utility import PrincipalAnnotationUtility | ||
from zope.principalannotation.interfaces import IPrincipalAnnotationUtility | ||
component.getGlobalSiteManager().registerUtility(PrincipalAnnotationUtility(), | ||
IPrincipalAnnotationUtility) | ||
|
||
def publish(self, path, basic=None, form=None): | ||
if basic: | ||
self._testapp.authorization = ('Basic', tuple(basic.split(':'))) | ||
else: | ||
self._testapp.authorization = None | ||
env = {'wsgi.handleErrors': False} | ||
if form: | ||
response = self._testapp.post(path, params=form, extra_environ=env) | ||
else: | ||
response = self._testapp.get(path, extra_environ=env) | ||
return response |
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
Oops, something went wrong.