projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4751048
)
test iter_lines
author
Kenneth Reitz
<me@kennethreitz.com>
Wed, 14 Dec 2011 15:34:31 +0000
(10:34 -0500)
committer
Kenneth Reitz
<me@kennethreitz.com>
Wed, 14 Dec 2011 15:34:31 +0000
(10:34 -0500)
test_requests.py
patch
|
blob
|
history
diff --git
a/test_requests.py
b/test_requests.py
index
8a9ea71
..
829d2a9
100755
(executable)
--- a/
test_requests.py
+++ b/
test_requests.py
@@
-592,5
+592,16
@@
class RequestsTestSuite(unittest.TestCase):
assert r2._content
assert r2.content
+ def test_iter_lines(self):
+
+ lines = (0, 2, 10, 100)
+
+ for i in lines:
+
+ r = requests.get(httpbin('stream', str(i)), prefetch=False)
+ len_lines = len([l for l in r.iter_lines()])
+
+ self.assertEqual(i, len_lines)
+
if __name__ == '__main__':
unittest.main()