Skip to content

Commit

Permalink
Attempt at issue opsdroid#270
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioRosado committed Oct 19, 2017
1 parent 765c8ec commit 62b6181
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_parser_witai.py
@@ -1,7 +1,7 @@
import asynctest
import asynctest.mock as amock

from aiohttp import helpers
from aiohttp import helpers, ClientOSError

from opsdroid.core import OpsDroid
from opsdroid.matchers import match_witai
Expand Down Expand Up @@ -196,3 +196,12 @@ async def test_parse_witai_no_intent(self):
opsdroid.config['parsers'][0])

self.assertFalse(mock_skill.called)

async def test_call_witai_ClientError(self):
result = amock.Mock()
result.json = amock.CoroutineMock()

with amock.patch('aiohttp.ClientSession.get') as patched_request:
patched_request.return_value = helpers.create_future(self.loop)
patched_request.set_exception(ClientOSError())
self.assertTrue(ClientOSError)

0 comments on commit 62b6181

Please sign in to comment.