Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add a unit test to exercise chunking behavior #780

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

Bug #18972 https://code.djangoproject.com/ticket/18972 reports that the math used by django.core.servers.basehttp.ServerHandler.write to break large data into chunks before writing is incorrect.This issue is valid, but since an array slice whose end exceeds the array's length automatically truncates, nothing actually breaks because of this mistake.

@doda has contributed a patch to address the problem, but no unit tests accompany it.

This commit adds a unit test that exercises the chunking code, proves that no data is currently lost, and allows for easy refactoring of the chunking code.

Add a unit test to exercise chunking behavior
Bug #18972 reports that the math used
django.core.servers.basehttp.ServerHandler.write to break large data
into chunks before writing is incorrect, but since an array slice whose
end exceeds the array's length automatically truncates, nothing actually
breaks because of this mistake.

This commit adds a unit test that verifies this and allows for easy
refactoring of the chunking code.
Member

charettes commented Feb 26, 2013

#782 has the patch and test.

@charettes charettes closed this Feb 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment