Restore prior expectation about Pod.text

master
Jason R. Coombs 8 years ago
parent b69b312692
commit 14ba338b1e
  1. 8
      wolframalpha/__init__.py
  2. 2
      wolframalpha/test_client.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):
"""

@ -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')

Loading…
Cancel
Save