This file is indexed.

/usr/share/pyshared/zope/traversing/tests/test_physicallocationadapters.py is in python-zope.traversing 3.13.2-2fakesync1.

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
63
##############################################################################
#
# Copyright (c) 2001, 2002 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.
#
##############################################################################
"""Physical Location Adapter Tests
"""
from unittest import TestCase, main, makeSuite

from zope.container.contained import contained
from zope.interface import implements
from zope.location.interfaces import ILocationInfo, IRoot
from zope.site.site import LocalSiteManager
from zope.site.site import SiteManagerContainer
from zope.testing.cleanup import CleanUp

import zope.traversing.testing


class Root(object):
    implements(IRoot)

    __parent__ = None


class C(object):
    pass


class Test(CleanUp, TestCase):

    def test(self):
        zope.traversing.testing.setUp()

        root = Root()
        f1 = contained(C(), root, name='f1')
        f2 = contained(SiteManagerContainer(), f1, name='f2')
        f3 = contained(C(), f2, name='f3')
        
        adapter = ILocationInfo(f3)

        self.assertEqual(adapter.getPath(), '/f1/f2/f3')
        self.assertEqual(adapter.getName(), 'f3')
        self.assertEqual(adapter.getRoot(), root)
        self.assertEqual(adapter.getNearestSite(), root)

        f2.setSiteManager(LocalSiteManager(f2))
        self.assertEqual(adapter.getNearestSite(), f2)

        
def test_suite():
    return makeSuite(Test)

if __name__=='__main__':
    main(defaultTest='test_suite')