def test_quotes(self, name, input, expected): stream = p.TextIO() p.pprint(input, stream=stream) assert_equal(stream.getvalue().rstrip("\n"), expected)
def test_expected_input(self, expected, input): stream = p.TextIO() p.pprint(input, stream=stream) assert_equal(stream.getvalue().rstrip("\n"), expected)
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)
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)