change old tests from usernames to uuids

This commit is contained in:
jomo 2020-12-12 22:50:29 +01:00
parent ef4b2f8005
commit 1328f98746

View File

@ -535,7 +535,7 @@ describe("Crafatar", function() {
}); });
it("should return a 422 (invalid render type)", function(done) { it("should return a 422 (invalid render type)", function(done) {
request.get("http://localhost:3000/renders/invalid/Jake_0", function(error, res, body) { request.get("http://localhost:3000/renders/invalid/2d5aa9cdaeb049189930461fc9b91cc5", function(error, res, body) {
assert.ifError(error); assert.ifError(error);
assert.strictEqual(res.statusCode, 422); assert.strictEqual(res.statusCode, 422);
done(); done();
@ -584,7 +584,7 @@ describe("Crafatar", function() {
describe("Networking: Cape", function() { describe("Networking: Cape", function() {
it("should not fail (guaranteed cape)", function(done) { it("should not fail (guaranteed cape)", function(done) {
helpers.get_cape(rid(), "Dinnerbone", function(err, hash, status, img) { helpers.get_cape(rid(), "61699b2ed3274a019f1e0ea8c3f06bc6", function(err, hash, status, img) {
assert.strictEqual(err, null); assert.strictEqual(err, null);
done(); done();
}); });
@ -593,13 +593,13 @@ describe("Crafatar", function() {
before(function() { before(function() {
cache.get_redis().flushall(); cache.get_redis().flushall();
}); });
helpers.get_cape(rid(), "Dinnerbone", function(err, hash, status, img) { helpers.get_cape(rid(), "61699b2ed3274a019f1e0ea8c3f06bc6", function(err, hash, status, img) {
assert.strictEqual(err, null); assert.strictEqual(err, null);
done(); done();
}); });
}); });
it("should not be found", function(done) { it("should not be found", function(done) {
helpers.get_cape(rid(), "Jake_0", function(err, hash, status, img) { helpers.get_cape(rid(), "2d5aa9cdaeb049189930461fc9b91cc5", function(err, hash, status, img) {
assert.ifError(err); assert.ifError(err);
assert.strictEqual(img, null); assert.strictEqual(img, null);
done(); done();
@ -609,7 +609,7 @@ describe("Crafatar", function() {
describe("Networking: Skin", function() { describe("Networking: Skin", function() {
it("should not fail", function(done) { it("should not fail", function(done) {
helpers.get_cape(rid(), "Jake_0", function(err, hash, status, img) { helpers.get_cape(rid(), "2d5aa9cdaeb049189930461fc9b91cc5", function(err, hash, status, img) {
assert.strictEqual(err, null); assert.strictEqual(err, null);
done(); done();
}); });
@ -618,7 +618,7 @@ describe("Crafatar", function() {
before(function() { before(function() {
cache.get_redis().flushall(); cache.get_redis().flushall();
}); });
helpers.get_cape(rid(), "Jake_0", function(err, hash, status, img) { helpers.get_cape(rid(), "2d5aa9cdaeb049189930461fc9b91cc5", function(err, hash, status, img) {
assert.strictEqual(err, null); assert.strictEqual(err, null);
done(); done();
}); });
@ -686,15 +686,16 @@ describe("Crafatar", function() {
cache.get_redis().flushall(); cache.get_redis().flushall();
}); });
it("uuid SHOULD be rate limited", function(done) { // Mojang has changed its rate limiting, so we no longer expect to hit the rate limit
networking.get_profile(rid(), uuid, function() { // it("uuid SHOULD be rate limited", function(done) {
networking.get_profile(rid(), uuid, function(err, profile) { // networking.get_profile(rid(), uuid, function() {
assert.strictEqual(err.toString(), "HTTP: 429"); // networking.get_profile(rid(), uuid, function(err, profile) {
assert.strictEqual(profile, null); // assert.strictEqual(err.toString(), "HTTP: 429");
done(); // assert.strictEqual(profile, null);
}); // done();
}); // });
}); // });
// });
it("CloudFront rate limit is handled", function(done) { it("CloudFront rate limit is handled", function(done) {
var original_rate_limit = config.server.sessions_rate_limit; var original_rate_limit = config.server.sessions_rate_limit;