This file is indexed.

/usr/lib/python2.7/dist-packages/funcparserlib/tests/test_json.py is in python-funcparserlib 0.3.6-4.

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
87
88
89
90
91
92
93
94
95
96
97
# -*- coding: utf-8 -*-

import unittest
from funcparserlib.parser import NoParseError
from funcparserlib.lexer import LexerError
import json


class JsonTest(unittest.TestCase):
    def t(self, data, expected=None):
        self.assertEqual(json.loads(data), expected)

    def test_1_array(self):
        self.t(u'[1]', [1])

    def test_1_object(self):
        self.t(u'{"foo": "bar"}', {u'foo': u'bar'})

    def test_bool_and_null(self):
        self.t(u'[null, true, false]', [None, True, False])

    def test_empty_array(self):
        self.t(u'[]', [])

    def test_empty_object(self):
        self.t(u'{}', {})

    def test_many_array(self):
        self.t(u'[1, 2, [3, 4, 5], 6]', [1, 2, [3, 4, 5], 6])

    def test_many_object(self):
        self.t(u'''
            {
                "foo": 1,
                "bar":
                {
                    "baz": 2,
                    "quux": [true, false],
                    "{}": {}
                },
                "spam": "eggs"
            }
        ''', {
            u'foo': 1,
            u'bar': {
                u'baz': 2,
                u'quux': [True, False],
                u'{}': {},
            },
            u'spam': u'eggs',
        })

    def test_null(self):
        try:
            self.t(u'')
        except NoParseError:
            pass
        else:
            self.fail('must raise NoParseError')

    def test_numbers(self):
        self.t(u'''\
            [
                0, 1, -1, 14, -14, 65536,
                0.0, 3.14, -3.14, -123.456,
                6.67428e-11, -1.602176e-19, 6.67428E-11
            ]
        ''', [
            0, 1, -1, 14, -14, 65536,
            0.0, 3.14, -3.14, -123.456,
            6.67428e-11, -1.602176e-19, 6.67428E-11,
        ])

    def test_strings(self):
        self.t(ur'''
            [
                ["", "hello", "hello world!"],
                ["привет, мир!", "λx.x"],
                ["\"", "\\", "\/", "\b", "\f", "\n", "\r", "\t"],
                ["\u0000", "\u03bb", "\uffff", "\uFFFF"],
                ["вот функция идентичности:\nλx.x\nили так:\n\u03bbx.x"]
            ]
        ''', [
            [u'', u'hello', u'hello world!'],
            [u'привет, мир!', u'λx.x'],
            [u'"', u'\\', u'/', u'\x08', u'\x0c', u'\n', u'\r', u'\t'],
            [u'\u0000', u'\u03bb', u'\uffff', u'\uffff'],
            [u'вот функция идентичности:\nλx.x\nили так:\n\u03bbx.x'],
        ])

    def test_toplevel_string(self):
        try:
            self.t(u'неправильно')
        except LexerError:
            pass
        else:
            self.fail('must raise LexerError')