X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fcommon.git;a=blobdiff_plain;f=osm_common%2Ftests%2Ftest_msgbase.py;fp=osm_common%2Ftests%2Ftest_msgbase.py;h=41def48899fd8dcfb10d2ef144a4681a6c856c97;hp=d5092b1b42e85d1bc13acf3ff3b33254d78f8b0c;hb=a06b854f2b278aaee015fc1f76015895f8cf50c1;hpb=b2d732a70efa33e4bc478d351d64bc4adb4ea332 diff --git a/osm_common/tests/test_msgbase.py b/osm_common/tests/test_msgbase.py index d5092b1..41def48 100644 --- a/osm_common/tests/test_msgbase.py +++ b/osm_common/tests/test_msgbase.py @@ -16,7 +16,7 @@ # For those usages not covered by the Apache License, Version 2.0 please # contact: esousa@whitestack.com or alfonso.tiernosepulveda@telefonica.com ## - +import asyncio import http from osm_common.msgbase import MsgBase, MsgException @@ -64,20 +64,18 @@ def test_read(msg_base): assert excinfo.value.http_code == http.HTTPStatus.INTERNAL_SERVER_ERROR -def test_aiowrite(msg_base, event_loop): +def test_aiowrite(msg_base): with pytest.raises(MsgException) as excinfo: - event_loop.run_until_complete( - msg_base.aiowrite("test", "test", "test", event_loop) - ) + asyncio.run(msg_base.aiowrite("test", "test", "test")) assert str(excinfo.value).startswith( exception_message("Method 'aiowrite' not implemented") ) assert excinfo.value.http_code == http.HTTPStatus.INTERNAL_SERVER_ERROR -def test_aioread(msg_base, event_loop): +def test_aioread(msg_base): with pytest.raises(MsgException) as excinfo: - event_loop.run_until_complete(msg_base.aioread("test", event_loop)) + asyncio.run(msg_base.aioread("test")) assert str(excinfo.value).startswith( exception_message("Method 'aioread' not implemented") )