예제 #1
0
 def test_file_iteration_with_mac_newline_at_chunk_boundary(self):
     f = File(BytesIO(b'one\rtwo\rthree'))
     # Set chunk size to create a boundary after \r:
     # b'one\r...
     #        ^
     f.DEFAULT_CHUNK_SIZE = 4
     self.assertEqual(list(f), [b'one\r', b'two\r', b'three'])
예제 #2
0
 def test_file_iteration_with_windows_newline_at_chunk_boundary(self):
     f = File(BytesIO(b'one\r\ntwo\r\nthree'))
     # Set chunk size to create a boundary between \r and \n:
     # b'one\r\n...
     #        ^
     f.DEFAULT_CHUNK_SIZE = 4
     self.assertEqual(list(f), [b'one\r\n', b'two\r\n', b'three'])
예제 #3
0
파일: tests.py 프로젝트: LouisAmon/django
 def test_file_iteration_with_mac_newline_at_chunk_boundary(self):
     f = File(BytesIO(b'one\rtwo\rthree'))
     # Set chunk size to create a boundary after \r:
     # b'one\r...
     #        ^
     f.DEFAULT_CHUNK_SIZE = 4
     self.assertEqual(list(f), [b'one\r', b'two\r', b'three'])
예제 #4
0
파일: tests.py 프로젝트: LouisAmon/django
 def test_file_iteration_with_windows_newline_at_chunk_boundary(self):
     f = File(BytesIO(b'one\r\ntwo\r\nthree'))
     # Set chunk size to create a boundary between \r and \n:
     # b'one\r\n...
     #        ^
     f.DEFAULT_CHUNK_SIZE = 4
     self.assertEqual(list(f), [b'one\r\n', b'two\r\n', b'three'])
예제 #5
0
파일: tests.py 프로젝트: jpadilla/django
 def test_file_iteration_with_unix_newline_at_chunk_boundary(self):
     f = File(BytesIO(b"one\ntwo\nthree"))
     # Set chunk size to create a boundary after \n:
     # b'one\n...
     #        ^
     f.DEFAULT_CHUNK_SIZE = 4
     self.assertEqual(list(f), [b"one\n", b"two\n", b"three"])
예제 #6
0
 def test_file_iteration_with_unix_newline_at_chunk_boundary(self):
     f = File(BytesIO(b"one\ntwo\nthree"))
     # Set chunk size to create a boundary after \n:
     # b'one\n...
     #        ^
     f.DEFAULT_CHUNK_SIZE = 4
     self.assertEqual(list(f), [b"one\n", b"two\n", b"three"])