Skip to content

Commit

Permalink
Add a test to make sure GenericBreadcrumb matches the interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Feb 8, 2008
1 parent 03e2498 commit f2f4fcb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/z3c/breadcrumb/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import unittest
from zope.testing import doctest
from zope.app.testing import placelesssetup, setup
from zope.traversing.interfaces import IContainmentRoot
from zope.interface.verify import verifyObject
from zope.interface import implements
from zope.publisher.browser import TestRequest


def doctest_Breadcrumbs_interface():
Expand All @@ -33,6 +36,19 @@ def doctest_Breadcrumbs_interface():
"""


def doctest_GenericBreadcrumb_interface():
"""Test that GenericBreadcrumb matches the interface
>>> from z3c.breadcrumb import browser, interfaces
>>> class RootStub(object):
... implements(IContainmentRoot)
>>> breadcrumb = browser.GenericBreadcrumb(RootStub(), TestRequest())
>>> verifyObject(interfaces.IBreadcrumb, breadcrumb)
True
"""


def setUp(test):
site = setup.placefulSetUp(site=True)
test.globs['rootFolder'] = site
Expand All @@ -47,5 +63,6 @@ def test_suite():
'README.txt',
setUp=setUp, tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
doctest.DocTestSuite(),
doctest.DocTestSuite(
setUp=setUp, tearDown=tearDown),
])

0 comments on commit f2f4fcb

Please sign in to comment.