Add test capturing need to raise an exception when the app id is invalid.

This commit is contained in:
Jason R. Coombs 2014-06-08 10:48:47 +01:00
parent b57a27da28
commit 1a265a7c68

View File

@ -2,6 +2,8 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import pytest
import wolframalpha import wolframalpha
app_id = 'Q59EW4-7K8AHE858R' app_id = 'Q59EW4-7K8AHE858R'
@ -13,3 +15,8 @@ def test_basic():
assert len(res.pods) > 0 assert len(res.pods) > 0
results = list(res.results) results = list(res.results)
assert results[0].text == '86 °F (degrees Fahrenheit)' assert results[0].text == '86 °F (degrees Fahrenheit)'
def test_invalid_app_id():
client = wolframalpha.Client('abcdefg')
with pytest.raises(Exception):
client.query('30 deg C in deg F')