This file is indexed.

/usr/lib/python3/dist-packages/testrepository/tests/__init__.py is in python3-testrepository 0.0.20-2.

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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# Copyright (c) 2009, 2010 Testrepository Contributors
# 
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# license you chose for the specific language governing permissions and
# limitations under that license.

"""The testrepository tests and test only code."""

import unittest

import testresources
from testscenarios import generate_scenarios
from testtools import TestCase


class ResourcedTestCase(TestCase, testresources.ResourcedTestCase):
    """Make all testrepository tests have resource support."""


class _Wildcard(object):
    """Object that is equal to everything."""

    def __repr__(self):
        return '*'

    def __eq__(self, other):
        return True

    def __ne__(self, other):
        return False


Wildcard = _Wildcard()


class StubTestCommand:

    def __init__(self, filter_tags=None):
        self.results = []
        self.filter_tags = filter_tags or set()

    def __call__(self, ui, repo):
        return self

    def get_filter_tags(self):
        return self.filter_tags


def test_suite():
    packages = [
        'arguments',
        'commands',
        'repository',
        'ui',
        ]
    names = [
        'arguments',
        'commands',
        'matchers',
        'monkeypatch',
        'repository',
        'results',
        'setup',
        'stubpackage',
        'testcommand',
        'testr',
        'ui',
        ]
    module_names = ['testrepository.tests.test_' + name for name in names]
    loader = unittest.TestLoader()
    suite = loader.loadTestsFromNames(module_names)
    result = testresources.OptimisingTestSuite()
    result.addTests(generate_scenarios(suite))
    for pkgname in packages:
        pkg = __import__('testrepository.tests.' + pkgname, globals(),
            locals(), ['test_suite'])
        result.addTests(generate_scenarios(pkg.test_suite()))
    return result