From 1a70fb3e410d061c47e9691e2202d81aa3841bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Fr=C3=B6hlich?= Date: Mon, 19 Jul 2021 19:49:57 +0200 Subject: [PATCH] write tests --- tests/api/tcf.nim | 6 +++++- tests/api/thttp.nim | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/api/tcf.nim b/tests/api/tcf.nim index 0f59e13..a5f6af3 100644 --- a/tests/api/tcf.nim +++ b/tests/api/tcf.nim @@ -15,8 +15,12 @@ block: # fetch mod by id doAssert cfMod.name == "Biomes O' Plenty" block: # fetch mod by slug - let cfMod = waitFor(fetchMod("appleskin")) + var cfMod = waitFor(fetchMod("appleskin")) doAssert cfMod.projectId == 248787 + cfMod = waitFor(fetchMod("dtbop")) + doAssert cfMod.projectId == 289529 + cfMod = waitFor(fetchMod("dtphc")) + doAssert cfMod.projectId == 307560 block: # fetch mod files let modFiles = waitFor(fetchModFiles(248787)) diff --git a/tests/api/thttp.nim b/tests/api/thttp.nim index 4fd620d..d64de2f 100644 --- a/tests/api/thttp.nim +++ b/tests/api/thttp.nim @@ -5,7 +5,9 @@ discard """ import asyncdispatch, api/http block: # fetch - let googleHttpsReq = fetch("https://www.google.com") - let googleHttpReq = fetch("http://www.google.com") let exampleReq = fetch("https://example.com") - waitFor(googleHttpsReq and googleHttpReq and exampleReq) + discard waitFor(exampleReq) + +block: # post + let apiTestReq = post("https://httpbin.org/post", "{}") + discard waitFor(apiTestReq)