/usr/share/pyshared/zope/contentprovider/tests.py is in python-zope.contentprovider 3.7.2-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Content provider tests
$Id: tests.py 112004 2010-05-05 17:54:28Z tseaver $
"""
__docformat__ = 'restructuredtext'
import doctest
import os.path
import unittest
from zope.component import eventtesting
from zope.testing import cleanup
counter = 0
mtime_func = None
def setUp(test):
cleanup.setUp()
eventtesting.setUp()
from zope.browserpage.metaconfigure import registerType
from zope.contentprovider import tales
registerType('provider', tales.TALESProviderExpression)
# Make sure we are always reloading page template files ;-)
global mtime_func
mtime_func = os.path.getmtime
def number(x):
global counter
counter += 1
return counter
os.path.getmtime = number
def tearDown(test):
cleanup.tearDown()
os.path.getmtime = mtime_func
global counter
counter = 0
def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite('README.txt',
setUp=setUp, tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
globs = {'__file__': os.path.join(
os.path.dirname(__file__), 'README.txt')}
),
))
|