diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-19 17:59:07 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-19 17:59:07 (GMT) |
commit | 5ba84910ae25aff544272f223390482c63238c42 (patch) | |
tree | 96f4dd8f6d4965ae210a68ac96010a397eceb501 /Lib | |
parent | a24db67d4704550722db3181b38b3840ded989bc (diff) | |
download | cpython-5ba84910ae25aff544272f223390482c63238c42.zip cpython-5ba84910ae25aff544272f223390482c63238c42.tar.gz cpython-5ba84910ae25aff544272f223390482c63238c42.tar.bz2 |
Issue #7133: SSL objects now support the new buffer API.
This fixes the test_ssl failure.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_ssl.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 247ffcd..5aca135 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -662,20 +662,21 @@ else: except Exception, x: raise test_support.TestFailed("Unexpected exception: " + str(x)) else: - if connectionchatty: - if test_support.verbose: - sys.stdout.write( - " client: sending %s...\n" % (repr(indata))) - s.write(indata) - outdata = s.read() - if connectionchatty: - if test_support.verbose: - sys.stdout.write(" client: read %s\n" % repr(outdata)) - if outdata != indata.lower(): - raise test_support.TestFailed( - "bad data <<%s>> (%d) received; expected <<%s>> (%d)\n" - % (outdata[:min(len(outdata),20)], len(outdata), - indata[:min(len(indata),20)].lower(), len(indata))) + for arg in [indata, bytearray(indata), memoryview(indata)]: + if connectionchatty: + if test_support.verbose: + sys.stdout.write( + " client: sending %s...\n" % (repr(arg))) + s.write(arg) + outdata = s.read() + if connectionchatty: + if test_support.verbose: + sys.stdout.write(" client: read %s\n" % repr(outdata)) + if outdata != indata.lower(): + raise test_support.TestFailed( + "bad data <<%s>> (%d) received; expected <<%s>> (%d)\n" + % (outdata[:min(len(outdata),20)], len(outdata), + indata[:min(len(indata),20)].lower(), len(indata))) s.write("over\n") if connectionchatty: if test_support.verbose: |