From 14ba338b1e16567219ae3a00b6f6e2b685f54652 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 3 Sep 2016 12:24:46 -0400 Subject: [PATCH] Restore prior expectation about Pod.text --- wolframalpha/__init__.py | 8 ++++++-- wolframalpha/test_client.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wolframalpha/__init__.py b/wolframalpha/__init__.py index b2e0695..d715750 100644 --- a/wolframalpha/__init__.py +++ b/wolframalpha/__init__.py @@ -140,12 +140,16 @@ class Pod(ErrorHandler, object): return self.number_of_subpods @property - def text(self): + def texts(self): """ - Simply get the text from each subpod in this pod and return it in a list. + The text from each subpod in this pod as a list. """ return [subpod.text for subpod in self.subpods] + @property + def text(self): + return next(iter(self)).text + class Subpod(object): """ diff --git a/wolframalpha/test_client.py b/wolframalpha/test_client.py index 4ce9756..c017d6f 100644 --- a/wolframalpha/test_client.py +++ b/wolframalpha/test_client.py @@ -27,7 +27,7 @@ def test_basic(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)'] + assert results[0].text == '86 °F (degrees Fahrenheit)' def test_invalid_app_id(): client = wolframalpha.Client('abcdefg')