Extend test to capture exactly one result with exactly one text.

This commit is contained in:
Jason R. Coombs 2016-09-03 12:26:17 -04:00
parent 14ba338b1e
commit 946b5d1f4b

View File

@ -26,8 +26,10 @@ def test_basic(API_key):
client = wolframalpha.Client(API_key) client = wolframalpha.Client(API_key)
res = client.query('30 deg C in deg F') res = client.query('30 deg C in deg F')
assert len(res.pods) > 0 assert len(res.pods) > 0
results = list(res.results) result, = res.results
assert results[0].text == '86 °F (degrees Fahrenheit)' assert result.text == '86 °F (degrees Fahrenheit)'
assert result.texts == ['86 °F (degrees Fahrenheit)']
def test_invalid_app_id(): def test_invalid_app_id():
client = wolframalpha.Client('abcdefg') client = wolframalpha.Client('abcdefg')