nim-libp2p-experimental/tests/testdaemon.nim

16 lines
417 B
Nim
Raw Normal View History

2018-11-19 04:34:05 +00:00
import unittest
import asyncdispatch2
import ../libp2p/daemon/daemonapi
proc identitySpawnTest(): Future[bool] {.async.} =
var api = await newDaemonApi(sockpath = "/tmp/p2pd-1.sock")
var data = await api.identity()
await api.close()
result = true
when isMainModule:
suite "libp2p-daemon test suite":
test "Simple spawn and get identity test":
2018-11-19 04:42:50 +00:00
check:
waitFor(identitySpawnTest()) == true