From 946b5d1f4b850a7b04c613fa0ad3268f7cce9838 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 3 Sep 2016 12:26:17 -0400 Subject: [PATCH] Extend test to capture exactly one result with exactly one text. --- wolframalpha/test_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wolframalpha/test_client.py b/wolframalpha/test_client.py index c017d6f..76d2065 100644 --- a/wolframalpha/test_client.py +++ b/wolframalpha/test_client.py @@ -26,8 +26,10 @@ def test_basic(API_key): client = wolframalpha.Client(API_key) res = client.query('30 deg C in deg F') assert len(res.pods) > 0 - results = list(res.results) - assert results[0].text == '86 °F (degrees Fahrenheit)' + result, = res.results + assert result.text == '86 °F (degrees Fahrenheit)' + assert result.texts == ['86 °F (degrees Fahrenheit)'] + def test_invalid_app_id(): client = wolframalpha.Client('abcdefg')