Merge async and xmpp work #34

Merged
bmartin5692 merged 20 commits from dev_broken-XMPP into master 2019-05-23 15:22:58 +02:00
4 changed files with 20 additions and 4 deletions
Showing only changes of commit 7dc2504f2b - Show all commits

View file

@ -15,6 +15,7 @@ nose = "*"
coverage = "*"
mock = "*"
pylint = "*"
pbr = "*"
[pipenv]
allow_prereleases = true

10
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "f6a2679f2c348e81b120bfa9d06f544ed25c1fcea44d94c419e6af514579fdee"
"sha256": "6e5b4ccc879dfdf82f53f7966eac54af90f9b9a2ffd1da6f1ce126d0ca125fc9"
},
"pipfile-spec": 6,
"requires": {},
@ -331,6 +331,14 @@
"index": "pypi",
"version": "==1.3.7"
},
"pbr": {
"hashes": [
"sha256:6901995b9b686cb90cceba67a0f6d4d14ae003cd59bc12beb61549bdfbe3bc89",
"sha256:d950c64aeea5456bbd147468382a5bb77fe692c13c9f00f0219814ce5b642755"
],
"index": "pypi",
"version": "==5.2.0"
},
"pylint": {
"hashes": [
"sha256:5d77031694a5fb97ea95e828c8d10fc770a1df6eb3906067aaed42201a8a6a09",

View file

@ -1219,13 +1219,13 @@ class ConfServer:
except Exception as e:
confserverlog.exception("{}".format(e))
def disconnect(self):
async def disconnect(self):
try:
confserverlog.info("shutting down")
if self.run_async:
self.confthread.join()
else:
self.app.shutdown()
await self.app.shutdown()
except Exception as e:
confserverlog.exception("{}".format(e))

View file

@ -18,7 +18,14 @@ def async_return(result):
return f
def test_disconnect():
confserver.disconnect()
async def test_disconnect_async():
await confserver.disconnect()
loop = asyncio.get_event_loop()
# Test
loop.run_until_complete(test_disconnect_async())
def test_base():
if os.path.exists("tests/tmp.db"):