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

Method test_invalid_multiline_value

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

Source from the content-addressed store, hash-verified

885 self.assertEqual(set(cf['section2'].keys()), {'name22'})
886
887 def test_invalid_multiline_value(self):
888 if self.allow_no_value:
889 self.skipTest('if no_value is allowed, ParsingError is not raised')
890
891 invalid = textwrap.dedent("""\
892 [DEFAULT]
893 test {0} test
894 invalid""".format(self.delimiters[0])
895 )
896 cf = self.newconfig()
897 with self.assertRaises(configparser.ParsingError):
898 cf.read_string(invalid)
899 self.assertEqual(cf.get('DEFAULT', 'test'), 'test')
900 self.assertEqual(cf['DEFAULT']['test'], 'test')
901
902
903class StrictTestCase(BasicTestCase, unittest.TestCase):

Callers

nothing calls this directly

Calls 8

skipTestMethod · 0.80
read_stringMethod · 0.80
dedentMethod · 0.45
formatMethod · 0.45
newconfigMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected