[Python-checkins] cpython (3.3): Issue #18296: Try to fix TestSendfile.test_trailers() of test_os on FreeBSD
victor.stinner
python-checkins at python.org
Thu Aug 15 11:58:05 CEST 2013
http://hg.python.org/cpython/rev/924d327da3af
changeset: 85177:924d327da3af
branch: 3.3
parent: 85173:e22e7268e58a
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Aug 15 11:57:02 2013 +0200
summary:
Issue #18296: Try to fix TestSendfile.test_trailers() of test_os on FreeBSD
files:
Lib/test/test_os.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1950,16 +1950,17 @@
def test_trailers(self):
TESTFN2 = support.TESTFN + "2"
+ file_data = b"abcdef"
with open(TESTFN2, 'wb') as f:
- f.write(b"abcde")
+ f.write(file_data)
with open(TESTFN2, 'rb')as f:
self.addCleanup(os.remove, TESTFN2)
- os.sendfile(self.sockno, f.fileno(), 0, 4096,
- trailers=[b"12345"])
+ os.sendfile(self.sockno, f.fileno(), 0, len(file_data),
+ trailers=[b"1234"])
self.client.close()
self.server.wait()
data = self.server.handler_instance.get_data()
- self.assertEqual(data, b"abcde12345")
+ self.assertEqual(data, b"abcdef1234")
if hasattr(os, "SF_NODISKIO"):
def test_flags(self):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list