This file is indexed.

/usr/lib/python2.7/dist-packages/pygraphviz/tests/test_setup.py is in python-pygraphviz 1.4~rc1-1build2.

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
import sys
from nose.tools import *
from mock import patch

# inside distributed version, there is no setup_extra files already
sys.path.insert(0,'../..')
try:
    setup_extra = __import__('setup_extra')
except ImportError:
    setup_extra = None


def _get_values():
    return None, 'library'


def _get_dpkg_output():
    r = """libgvc: /usr/local/include/graphviz/gvc.h
                     gphviz: /usr/local/lib/graphviz/graphviz.so"""
    if sys.version_info >= (3, 0):
        s = bytes(r, encoding='utf8')
    else:
        s = str(r)
    return s


def test_try():
    if setup_extra:
        i, l = None, None
        i, l = setup_extra._try_configure(i, l, _get_values)
        assert_equals(i, None)
        assert_equals(l, 'library')


@patch('subprocess.check_output')
def test_dpkg_config(subprocess_mock):
    if setup_extra:
        subprocess_mock.return_value = _get_dpkg_output()
        i, l = setup_extra._dpkg_config()
        assert_equal(i, '/usr/local/include/graphviz')
        assert_equal(l, '/usr/local/lib/graphviz')


def test_b2str():
    if setup_extra:
        if sys.version_info >= (3, 0):
            r = bytes('abc', encoding='utf8')
        else:
            r = str('abc')
        s = setup_extra._b2str(r)
        assert_equal(s, u'abc')