summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2011-04-16 19:18:43 +0000
committerGiampaolo Rodola <g.rodola@gmail.com>2011-04-16 19:18:43 +0000
commit1181807e1fa689992abefa27a0920df09ff67630 (patch)
treeabdbc1d7919e2237c2798a7767f556efad7cbe13 /test
parentaeb1e83b15e81f869b791e693b08400e15dad33d (diff)
downloadpysendfile-1181807e1fa689992abefa27a0920df09ff67630.tar.gz
add test for sbytes = 0; on OSX and FreeBSD this means 'send the whole file'
Diffstat (limited to 'test')
-rw-r--r--test/test_sendfile.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_sendfile.py b/test/test_sendfile.py
index 048d3c7..3e7c1d6 100644
--- a/test/test_sendfile.py
+++ b/test/test_sendfile.py
@@ -256,6 +256,15 @@ class TestSendfile(unittest.TestCase):
else:
self.fail("exception not raised")
+ if sys.platform.startswith('darwin') \
+ or sys.platform.startswith('freebsd'):
+ def test_send_whole_file(self):
+ ret = sendfile_wrapper(self.sockno, self.fileno, 0, 0)
+ self.client.close()
+ self.server.wait()
+ data = self.server.handler_instance.get_data()
+ self.assertEqual(hash(data), hash(DATA))
+
if hasattr(sendfile, "SF_NODISKIO"):
def test_flags(self):
try: