Skip to content

Commit

Permalink
fix: In testCatFile, fetch a reliable sample file.
Browse files Browse the repository at this point in the history
The request to fetch the IPNS file times out. Change to a CID of a sample image from the IPFS web site which is likely to be fetched. With this change, all the tests pass.

Signed-off-by: jefft0 <jeff@thefirst.org>
  • Loading branch information
jefft0 committed Jul 8, 2022
1 parent a36f2ad commit 3dc6933
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public void testDNSRequest() throws Exception {
@Test
public void testCatFile() throws Exception {
byte[] latestRaw = ipfs.newRequest("cat")
.withArgument("/ipns/xkcd.hacdias.com/latest/info.json")
.withArgument("/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu")
.send();

try {
new JSONObject(new String(latestRaw));
} catch (JSONException e) {
fail("error while parsing fetched JSON: " + new String(latestRaw));
}
assertEquals(
"response should have the correct length",
12435,
latestRaw.length
);
}
}

0 comments on commit 3dc6933

Please sign in to comment.