Refresh the homepage and improve export and draft guidance
This commit is contained in:
9
tests/java/UploadSmoke.java
Normal file
9
tests/java/UploadSmoke.java
Normal file
@@ -0,0 +1,9 @@
|
||||
import dev.minegeo.plugin.UploadClient;
|
||||
import com.google.gson.JsonParser;
|
||||
import java.nio.file.*;
|
||||
public class UploadSmoke {
|
||||
public static void main(String[] args) throws Exception {
|
||||
String token=JsonParser.parseString(Files.readString(Path.of(args[2]))).getAsJsonObject().get("token").getAsString();
|
||||
new UploadClient(args[0],token).upload(Path.of(args[1]),message->System.out.println(message),()->false);
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,29 @@ test("dataset requires five unique in-bounds viewpoints and safe paths", () => {
|
||||
assets: [{ path: "terrain.json.gz", sha256: "a".repeat(64), bytes: 100 }],
|
||||
};
|
||||
assert.equal(datasetSchema.safeParse(base).success, true);
|
||||
assert.equal(datasetSchema.safeParse({ ...base, assets: [] }).success, false);
|
||||
assert.equal(
|
||||
datasetSchema.safeParse({ ...base, source: "fabric" }).success,
|
||||
false,
|
||||
);
|
||||
const capture = {
|
||||
...base,
|
||||
source: "fabric",
|
||||
assets: [
|
||||
"map.png",
|
||||
...base.viewpoints.flatMap((point) =>
|
||||
["px", "nx", "py", "ny", "pz", "nz"].map(
|
||||
(face) => `${point.id}/${face}.png`,
|
||||
),
|
||||
),
|
||||
].map((path) => ({ path, sha256: "a".repeat(64), bytes: 100 })),
|
||||
};
|
||||
assert.equal(datasetSchema.safeParse(capture).success, true);
|
||||
assert.equal(
|
||||
datasetSchema.safeParse({ ...capture, assets: capture.assets.slice(1) })
|
||||
.success,
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
datasetSchema.safeParse({ ...base, viewpoints: base.viewpoints.slice(1) })
|
||||
.success,
|
||||
|
||||
Reference in New Issue
Block a user