Created
December 1, 2010 20:45
-
-
Save Kami/724188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports['PUT bar@1.0.tar.gz'] = function(assert, beforeExit) { | |
| var n = 0; | |
| ps.on('bundles listed', function() { | |
| var req = { | |
| url: '/bundles/bar/bar@1.0.tar.gz', | |
| method: 'PUT', | |
| headers: { | |
| 'Transfer-Encoding': 'chunked' | |
| }, | |
| streamer: function(request) { | |
| var intervalId; | |
| function write_some() { | |
| request.write(misc.randstr(1024)); | |
| if (++n === 1000) { | |
| clearInterval(intervalId); | |
| request.end(); | |
| } | |
| } | |
| intervalId = setInterval(write_some, 2); | |
| } | |
| }; | |
| assert.response(getServer(), req, function(res) { | |
| n++; | |
| assert.equal(500, res.statusCode); | |
| }); | |
| }); | |
| beforeExit(function() { | |
| console.log(n); | |
| assert.equal(1001, n, 'Responses Received'); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment