add test for timing out on username info (#14)

This commit is contained in:
jomo 2014-11-23 22:01:11 +01:00
parent 464c1eab98
commit 148ea45631

View File

@ -144,10 +144,19 @@ describe('Crafatar', function() {
done();
});
});
it("should time out on profile download", function(done) {
it("should time out on uuid info download", function(done) {
var original_timeout = config.http_timeout;
config.http_timeout = 1;
networking.get_skin_url("069a79f444e94726a5befca90e38aaf5", function(err, profile) {
networking.get_skin_url("069a79f444e94726a5befca90e38aaf5", function(err, skin_url) {
assert.strictEqual(err.code, "ETIMEDOUT");
config.http_timeout = original_timeout;
done();
});
});
it("should time out on username info download", function(done) {
var original_timeout = config.http_timeout;
config.http_timeout = 1;
networking.get_skin_url("redstone_sheep", function(err, skin_url) {
assert.strictEqual(err.code, "ETIMEDOUT");
config.http_timeout = original_timeout;
done();