~aptdaemon-developers/aptdaemon/1.x

« back to all changes in this revision

Viewing changes to tests/test_configparser.py

  • Committer: Sebastian Heinlein
  • Date: 2012-12-29 23:41:16 UTC
  • mfrom: (883.1.26 pep8)
  • Revision ID: devel@glatzor.de-20121229234116-nd390n01ut2fcfce
PEP8 fixes and test for the test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
21
# Licensed under the GNU General Public License Version 2
22
22
 
23
 
__author__  = "Sebastian Heinlein <devel@glatzor.de>"
 
23
__author__ = "Sebastian Heinlein <devel@glatzor.de>"
24
24
 
25
25
import os
26
26
import sys
49
49
        """
50
50
        cf = self.parser.parse(s.split("\n"))
51
51
        self.assertEqual(cf["apt::changelogs::server"].string,
52
 
                          "http://changelogs.ubuntu.com/changelogs")
 
52
                         "http://changelogs.ubuntu.com/changelogs")
53
53
 
54
54
    def test_multi_line_comments(self):
55
55
        s = """/*
57
57
 */
58
58
 
59
59
DPkg {
60
 
        Post-Invoke {"which dzhandle";};
 
60
    Post-Invoke {"which dzhandle";};
61
61
}
62
62
        """
63
63
        cf = self.parser.parse(s.split("\n"))
78
78
                    key = key[:-2]
79
79
                    value_list_apt = config_apt.value_list(key)
80
80
                    if value_list_apt:
81
 
                        value_list = [val.string for val in config[key.lower()]]
 
81
                        value_list = [val.string for val in
 
82
                                      config[key.lower()]]
82
83
                        self.assertTrue(value_list_apt == value_list,
83
84
                                        "%s: %s != %s" % (key, value_list_apt,
84
85
                                                          value_list))
85
86
                else:
86
87
                    value_apt = config_apt[key]
87
88
                    if value_apt:
88
 
                        self.assertTrue(value_apt == config[key.lower()].string)
 
89
                        self.assertTrue(
 
90
                            value_apt == config[key.lower()].string)
89
91
 
90
92
 
91
93
@unittest.skipIf(sys.version_info.major < 3, "Only Python3")