summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2012-12-23 20:54:09 +0000
committerTres Seaver <tseaver@palladion.com>2012-12-23 20:54:09 +0000
commitabb7cd4d62b23edcf7fdafe32203d1f9edc08f7b (patch)
treee135139c00b12508106ea962c845109037a4310d /docs
parentb7623775f6f2b487981857ec0f97e33ed758671f (diff)
downloadzope-security-abb7cd4d62b23edcf7fdafe32203d1f9edc08f7b.tar.gz
Convert doctests in 'zope.security.proxy' into Sphinx doctest snppets.
They are still tested under 'tox -e docs'.
Diffstat (limited to 'docs')
-rw-r--r--docs/api/proxy.rst43
-rw-r--r--docs/index.rst1
2 files changed, 44 insertions, 0 deletions
diff --git a/docs/api/proxy.rst b/docs/api/proxy.rst
new file mode 100644
index 0000000..665912a
--- /dev/null
+++ b/docs/api/proxy.rst
@@ -0,0 +1,43 @@
+:mod:`zope.security.proxy`
+===============================
+
+.. testsetup::
+
+ from zope.component.testing import setUp
+ setUp()
+
+.. autofunction:: zope.security.proxy.getTestProxyItems
+
+.. autofunction:: zope.security.proxy.isinstance
+
+.. doctest::
+
+ >>> from zope.security.proxy import isinstance
+ >>> class C1(object):
+ ... pass
+
+ >>> c = C1()
+ >>> isinstance(c, C1)
+ True
+
+ >>> from zope.security.checker import ProxyFactory
+ >>> isinstance(ProxyFactory(c), C1)
+ True
+
+ >>> class C2(C1):
+ ... pass
+
+ >>> c = C2()
+ >>> isinstance(c, C1)
+ True
+
+ >>> from zope.security.checker import ProxyFactory
+ >>> isinstance(ProxyFactory(c), C1)
+ True
+
+
+
+.. testcleanup::
+
+ from zope.component.testing import tearDown
+ tearDown()
diff --git a/docs/index.rst b/docs/index.rst
index 6f772a6..53c12c4 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -14,6 +14,7 @@ API Reference
api/management
api/permission
api/protectclass
+ api/proxy