MCPcopy Index your code
hub / github.com/python/cpython / test_reading

Method test_reading

Lib/test/test_configparser.py:1142–1154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
1156class ConfigParserTestCaseExtendedInterpolation(BasicTestCase, unittest.TestCase):
1157 config_class = configparser.ConfigParser

Callers

nothing calls this directly

Calls 6

newconfigMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45
sectionsMethod · 0.45
getMethod · 0.45
getintMethod · 0.45

Tested by

no test coverage detected