Open twisted-trac opened 12 years ago
@tomprince set owner to @moijes12 |
---|
Thanks for working on this. The test you added looks good, but could be improved by checking the message of the exception (there are a bunch of examples throughout the existing tests).
This test covers one case, but there are a bunch more need. Off hand:
Each of those probably deserves at least a couple of test cases.
@tomprince set owner to @moijes12 |
---|
Thanks. There are a couple of more things that it would be worthwhile to test.
noLongerQueued
switches the transport of the request from an in-memory transport to the one provided by the channel. There should be a test that verifies this.
test_noLongerQueuedWriteIfData
is trying to test, but I think it wants to test that the channel transport has the data that was originally written to the temporary request transport. (DummyChannel
has a test transport which can be used to check this).test_noLongerQueuedCleanupIfFinished
could be improved to use .notifyFinish()
and 'TestCase.successResultOfto verify that
_cleanupgets called.
notifyFinish` is something that is definitely going to happen, whereas the other could change..finished
should be set to True
rather than 1
. (I suspect this code predates the introduction of True
)Please resubmit for review, after addressing the above points.
@moijes12 commented |
---|
[moijes12] est_noLongerQueuedCleanupIfFinished verifyies that _cleanup gets called by checking that self.content is deleted.
[moijes12] The function documentation of test_noLongerQueuedWriteIfData clearly mentions its purpose. Also, I cannot find the test transport method in twisted.web.test.requesthelper.DummyChannel.
It should have complete test coverage (found while porting http.py to Python 3).
Attachments:
Searchable metadata
``` trac-id__6118 6118 type__defect defect reporter__exarkun exarkun priority__normal normal milestone__ branch__branches_Request_noLongerQueued_test_coverage_6118 branches/Request.noLongerQueued-test-coverage-6118 branch_author__moijes12 moijes12 status__new new resolution__None None component__web web keywords__ time__1350392883000000 1350392883000000 changetime__1374175473000000 1374175473000000 version__None None owner__moijes12 moijes12 cc__jknight ```