Tests: migrate to new mtgjson version

This commit is contained in:
Oleg Agafonov 2020-01-22 01:32:03 +04:00
parent 93d3ee4a93
commit 46d5b228cf
3 changed files with 5 additions and 3 deletions

2
.gitignore vendored
View file

@ -95,6 +95,8 @@ Mage.Verify/AllCards.json.zip
Mage.Verify/AllSets.json.zip
Mage.Verify/AllCards.json
Mage.Verify/AllSets.json
Mage.Verify/AllPrintings.json
Mage.Verify/AllPrintings.json.zip
Mage.Verify/db
releases

View file

@ -113,7 +113,7 @@ public final class MtgJson {
}
private static Map<String, JsonSet> loadAllSets() throws IOException {
return readFromZip("AllSets.json.zip", new TypeReference<Map<String, JsonSet>>() {
return readFromZip("AllPrintings.json.zip", new TypeReference<Map<String, JsonSet>>() {
});
}
@ -122,7 +122,7 @@ public final class MtgJson {
if (stream == null) {
File file = new File(filename);
if (!file.exists()) {
URLConnection connection = new URL("https://mtgjson.com/json/" + filename).openConnection();
URLConnection connection = new URL("https://mtgjson.com/files/" + filename).openConnection();
connection.setRequestProperty("user-agent", "xmage");
InputStream download = connection.getInputStream();
Files.copy(download, file.toPath(), StandardCopyOption.REPLACE_EXISTING);

View file

@ -765,7 +765,7 @@ public class VerifyCardDataTest {
checkSupertypes(card, ref);
checkTypes(card, ref);
checkColors(card, ref);
//checkNumbers(card, ref); // TODO: load data from allsets.json and check it (allcards.json do not have card numbers)
//checkNumbers(card, ref); // TODO: load data from AllPrintings.json and check it (allcards.json do not have card numbers)
checkBasicLands(card, ref);
checkMissingAbilities(card, ref);
checkWrongSymbolsInRules(card);