This file is indexed.

/usr/share/pyshared/simpleparse/tests/test_printers.py is in python-simpleparse 2.1.0a1-6build1.

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
"""Test the print-to-python-file module

This just uses the simpleparsegrammar declaration, which is
parsed, then linearised, then loaded as a Python module.
"""
import os, unittest
import test_grammarparser
testModuleFile = 'test_printers_garbage.py'


class PrintersTests(test_grammarparser.SimpleParseGrammarTests):
	def setUp( self ):
		from simpleparse import simpleparsegrammar, parser, printers, baseparser
		p = parser.Parser( simpleparsegrammar.declaration, 'declarationset')
		open(testModuleFile,'w').write(printers.asGenerator( p._generator ))
		import test_printers_garbage
		reload( test_printers_garbage )
		
		class RParser( test_printers_garbage.Parser, baseparser.BaseParser ):
			pass

		self.recursiveParser = RParser()
	def tearDown( self ):
		try:
			os.remove( testModuleFile )
		except IOError, err:
			pass
	def doBasicTest(self, parserName, testValue, expected, ):
		result = self.recursiveParser.parse( testValue, production=parserName )
		assert result == expected, '''\nexpected:%s\n     got:%s\n'''%( expected, result )

def getSuite():
	return unittest.makeSuite(PrintersTests,'test')

if __name__ == "__main__":
	unittest.main(defaultTest="getSuite")