add tests for streaming endpoint with fixed Content-Length

This previously caused an issue referenced here: https://github.com/excon/excon/commit/8e6457e86e8cf4e933d884068effa22d5f303ddc\#commitcomment-6513987

This issue was fixed in: https://github.com/excon/excon/commit/3f9d8122a8aed3c354f71e99bcef845d0487539f

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
reduce time-check on streaming tests

In case of sending Content-Length headers, the final response does not wait for the sleep to finish. Instead, the request is returned as soon as the final piece has been delivered. This is intended, so make sure the tests run accordingly.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
stream first, sleep later for streaming tests

When sleeping first and streaming second, in case of Content-Length headers there results will come back and the test will end while the server still has to go for another round of sleep 1s. This breaks following tests. To get around this issue, always sleep 1s first, then stream a piece of the result. The tests only need minimal adjustments to make it work and the purpose is still covered.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
simplify test runs for streaming tests with chunks

move out the common pieces into a separate function and use it for both the simple and the Content-Length header tests.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Merge pull request #396 from arlimus/test-streamy-content-length

add tests for streaming endpoint with fixed Content-Length