2012-06-06 23:23:23 +00:00
|
|
|
import time
|
|
|
|
import libpry
|
|
|
|
import requests
|
2012-06-06 23:39:37 +00:00
|
|
|
from libpathod import test, version
|
2012-06-06 23:23:23 +00:00
|
|
|
|
|
|
|
|
2012-06-06 23:39:37 +00:00
|
|
|
class uDaemonManual(libpry.AutoTree):
|
2012-06-06 23:23:23 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2012-06-06 23:39:37 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2012-06-06 23:23:23 +00:00
|
|
|
|
|
|
|
tests = [
|
2012-06-06 23:39:37 +00:00
|
|
|
uDaemonManual(),
|
2012-06-06 23:23:23 +00:00
|
|
|
uDaemon()
|
|
|
|
]
|