mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
__format(): Applied SF patch #482003 by Skip to fix multiline dict
output. Patch includes additional test case test_basic_line_wrap(). This patch is a candidate for Python 2.1.2.
This commit is contained in:
parent
3072ecdcd2
commit
00859c0538
2 changed files with 20 additions and 1 deletions
|
|
@ -77,6 +77,25 @@ class QueryTestCase(unittest.TestCase):
|
|||
(native, got, function))
|
||||
|
||||
|
||||
def test_basic_line_wrap(self):
|
||||
"""verify basic line-wrapping operation"""
|
||||
o = {'RPM_cal': 0,
|
||||
'RPM_cal2': 48059,
|
||||
'Speed_cal': 0,
|
||||
'controldesk_runtime_us': 0,
|
||||
'main_code_runtime_us': 0,
|
||||
'read_io_runtime_us': 0,
|
||||
'write_io_runtime_us': 43690}
|
||||
exp = """\
|
||||
{'RPM_cal': 0,
|
||||
'RPM_cal2': 48059,
|
||||
'Speed_cal': 0,
|
||||
'controldesk_runtime_us': 0,
|
||||
'main_code_runtime_us': 0,
|
||||
'read_io_runtime_us': 0,
|
||||
'write_io_runtime_us': 43690}"""
|
||||
self.assertEqual(pprint.pformat(o), exp)
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(QueryTestCase)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue