diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2011-02-09 19:16:44 +0000 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2011-02-09 19:16:44 +0000 |
commit | 1bc64043b3fcc427a5ec7a416835d9b1a5cda6c9 (patch) | |
tree | 6091eedccf90507b484fb3b2d47f0b57aad70a4d /test | |
parent | 84cc72b5c4e336e2fadd767f3de62194dd0ceebb (diff) | |
download | pysendfile-1bc64043b3fcc427a5ec7a416835d9b1a5cda6c9.tar.gz |
return just the number of bytes sent instead of a (bsent, offset) tuple (BSD and AIX).
Diffstat (limited to 'test')
-rw-r--r-- | test/test_sendfile.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test_sendfile.py b/test/test_sendfile.py index 5385f54..cc7aef4 100644 --- a/test/test_sendfile.py +++ b/test/test_sendfile.py @@ -222,15 +222,16 @@ class TestSendfile(unittest.TestCase): def test_headers(self): total_sent = 0 headers = _bytes("x") * 512 - sent, offset = sendfile.sendfile(self.sockno, self.fileno, 0, 4096, - headers=[headers]) + sent = sendfile.sendfile(self.sockno, self.fileno, 0, 4096, + headers=[headers]) total_sent += sent offset = 4096 nbytes = 4096 while 1: - sent, offset = sendfile_wrapper(self.sockno, self.fileno, offset, nbytes) + sent = sendfile_wrapper(self.sockno, self.fileno, offset, nbytes) if sent == 0: break + offset += sent total_sent += sent expected_data = headers + DATA @@ -243,15 +244,16 @@ class TestSendfile(unittest.TestCase): def test_trailers(self): total_sent = 0 trailers = _bytes("x") * 512 - sent, offset = sendfile.sendfile(self.sockno, self.fileno, 0, 4096, + sent = sendfile.sendfile(self.sockno, self.fileno, 0, 4096, trailers=[trailers]) total_sent += sent offset = 4096 nbytes = 4096 while 1: - sent, offset = sendfile_wrapper(self.sockno, self.fileno, offset, nbytes) + sent = sendfile_wrapper(self.sockno, self.fileno, offset, nbytes) if sent == 0: break + offset += sent total_sent += sent expected_data = DATA[:4096] + trailers |