This file is indexed.

/usr/share/pyshared/guidata/tests/config.py is in python-guidata 1.6.1-1.

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
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 CEA
# Pierre Raybaut
# Licensed under the terms of the CECILL License
# (see guidata/__init__.py for details)

"""Config test"""

SHOW = False # Do not show test in GUI-based test launcher

import unittest

from guidata.tests.all_features import TestParameters
from guidata.config import UserConfig

class TestBasic(unittest.TestCase):
    def setUp(self):
        self.test_save()
    
    def test_save(self):
        eta = TestParameters()
        eta.write_config(CONF, "TestParameters", "")
        #print "fin test_save"
    
    def test_load(self):
        eta = TestParameters()
        eta.read_config(CONF, "TestParameters", "")
        #print "fin test_load"

    def test_default(self):
        eta = TestParameters()
        eta.write_config(CONF, "etagere2", "")
        eta = TestParameters()
        eta.read_config(CONF, "etagere2", "")
        
        self.assertEqual(eta.fl2, 1.)
        self.assertEqual(eta.integer, 5)
        #print "fin test_default"
                         
    def test_restore(self):
        eta = TestParameters()
        eta.fl2 = 2
        eta.integer = 6
        eta.write_config(CONF, "etagere3", "")
        
        eta = TestParameters()
        eta.read_config(CONF, "etagere3", "")
        
        self.assertEqual(eta.fl2, 2.)
        self.assertEqual(eta.integer, 6)
        #print "fin test_restore"
        
if __name__=="__main__":
    CONF = UserConfig({})
    unittest.main()