This file is indexed.

/usr/share/pyshared/pygraphviz/tests/test.py is in python-pygraphviz 1.1-1.

This file is owned by root:root, with mode 0o755.

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
#!/usr/bin/env python

import sys
import doctest
import unittest
import glob
import os

def test_suite():
    test_files=['graph.txt','layout_draw.txt','attributes.txt','unicode.txt']
    try: # has setuptools
        from pkg_resources import resource_filename
        tests=[resource_filename(__name__, t) for t in test_files]
    except: # no setuptools
        import pygraphviz
        base=os.path.dirname(pygraphviz.__file__)
        tests=glob.glob(base+"/tests/"+"*.txt") 

    suite = unittest.TestSuite()
    for t in tests:
        s = doctest.DocFileSuite(t,module_relative=False)
        suite.addTest(s)
    return suite


def run():
    if sys.version_info[:2] < (2, 4):
        print "Python version 2.4 or later required for tests (%d.%d detected)." %  sys.version_info[:2]
        sys.exit(-1)
    runner = unittest.TextTestRunner()
    runner.run(test_suite())


if __name__ == "__main__":
    if sys.version_info[:2] < (2, 4):
        print "Python version 2.4 or later required for tests (%d.%d detected)." %  sys.version_info[:2]
        sys.exit(-1)
    try:
        import pygraphviz
    except:
        print "Can't import pygraphviz module, not in path"
        print sys.path
        raise
    
    run()