| 1140 | empty_lines_in_values = False |
| 1141 | |
| 1142 | def test_reading(self): |
| 1143 | smbconf = support.findfile("cfgparser.2", subdir="configdata") |
| 1144 | # check when we pass a mix of readable and non-readable files: |
| 1145 | cf = self.newconfig() |
| 1146 | parsed_files = cf.read([smbconf, "nonexistent-file"], encoding='utf-8') |
| 1147 | self.assertEqual(parsed_files, [smbconf]) |
| 1148 | sections = ['global', 'homes', 'printers', |
| 1149 | 'print$', 'pdf-generator', 'tmp', 'Agustin'] |
| 1150 | self.assertEqual(cf.sections(), sections) |
| 1151 | self.assertEqual(cf.get("global", "workgroup"), "MDKGROUP") |
| 1152 | self.assertEqual(cf.getint("global", "max log size"), 50) |
| 1153 | self.assertEqual(cf.get("global", "hosts allow"), "127.") |
| 1154 | self.assertEqual(cf.get("tmp", "echo command"), "cat %s; rm %s") |
| 1155 | |
| 1156 | class ConfigParserTestCaseExtendedInterpolation(BasicTestCase, unittest.TestCase): |
| 1157 | config_class = configparser.ConfigParser |