Пример #1
0
 def test_quotes(self, name, input, expected):
     stream = p.TextIO()
     p.pprint(input, stream=stream)
     assert_equal(stream.getvalue().rstrip("\n"), expected)
Пример #2
0
 def test_expected_input(self, expected, input):
     stream = p.TextIO()
     p.pprint(input, stream=stream)
     assert_equal(stream.getvalue().rstrip("\n"), expected)
Пример #3
0
 def test_unicode(self, name, input, expected, encoding="utf-8"):
     stream = p.TextIO(encoding=encoding)
     p.pprint(input, stream=stream)
     assert_equal(stream.getvalue().rstrip("\n"), expected)
Пример #4
0
 def test_back_and_forth(self, expected):
     input = eval(expected)
     stream = p.TextIO()
     p.pprint(input, stream=stream)
     assert_equal(stream.getvalue().rstrip("\n"), expected)