[sales] Test sales rest api

This commit is contained in:
Mark Spanbroek 2022-04-26 08:49:27 +02:00 committed by markspanbroek
parent cc9a4e2af6
commit 45c55ab2a8
2 changed files with 6 additions and 1 deletions

View File

@ -331,7 +331,7 @@ proc initRestApi*(node: DaggerNodeRef, conf: DaggerConf): RestRouter =
"\nRoot Dir: " & $conf.dataDir)
router.api(
MethodPost,
MethodGet,
"/api/dagger/v1/sales/availability") do (
size: Option[uint64],
duration: Option[uint64],

View File

@ -38,3 +38,8 @@ suite "Integration tests":
let info1 = client.get("http://localhost:8080/api/dagger/v1/info").body
let info2 = client.get("http://localhost:8081/api/dagger/v1/info").body
check info1 != info2
test "node handles new storage availability":
let baseurl = "http://localhost:8080/api/dagger/v1"
let url = baseurl & "/sales/availability?size=1&duration=1&minPrice=0x2A"
check client.get(url).status == "200 OK"