blob: c10cee4cdf048576f3e0b4f1eb9967d9a39ac39c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import time
import libpry
import requests
from libpathod import test, version
class uDaemonManual(libpry.AutoTree):
def test_startstop(self):
d = test.Daemon()
rsp = requests.get("http://localhost:%s/p/202"%d.port)
assert rsp.ok
assert rsp.status_code == 202
d.shutdown()
rsp = requests.get("http://localhost:%s/p/202"%d.port)
assert not rsp.ok
class uDaemon(libpry.AutoTree):
def setUpAll(self):
self.d = test.Daemon()
def tearDownAll(self):
self.d.shutdown()
def test_info(self):
assert tuple(self.d.info()["version"]) == version.IVERSION
tests = [
uDaemonManual(),
uDaemon()
]
|