Add simple daemon spawn test.
This commit is contained in:
parent
9262aa5e9e
commit
dc482dfb45
|
@ -10,4 +10,5 @@ skipDirs = @["tests", "Nim"]
|
||||||
requires "nim > 0.18.0"
|
requires "nim > 0.18.0"
|
||||||
|
|
||||||
task tests, "Runs the test suite":
|
task tests, "Runs the test suite":
|
||||||
exec "nim c -r tests/testpbvarint"
|
exec "nim c -r tests/testpbvarint"
|
||||||
|
exec "nim c -r tests/testdaemon"
|
|
@ -0,0 +1,14 @@
|
||||||
|
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":
|
||||||
|
waitFor identitySpawnTest() == true
|
Loading…
Reference in New Issue