summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-08-15 09:57:19 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-08-15 09:57:19 (GMT)
commitf0e521036caea5083e93cd5eca5500b9a1e945ad (patch)
tree4cd0b390ca8a5dc7df24fad2094ab0c22aeef86d /Lib
parent8ad39195775af35c16e4b03b6aa55f131981664e (diff)
parent5e4d6398a113a9f6bab6a108f0638b989fce09e8 (diff)
downloadcpython-f0e521036caea5083e93cd5eca5500b9a1e945ad.zip
cpython-f0e521036caea5083e93cd5eca5500b9a1e945ad.tar.gz
cpython-f0e521036caea5083e93cd5eca5500b9a1e945ad.tar.bz2
(Merge 3.3) Issue #18296: Try to fix TestSendfile.test_trailers() of test_os on FreeBSD
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_os.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index ea2949a..eb13667 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1963,16 +1963,17 @@ class TestSendfile(unittest.TestCase):
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):