Restore prior expectation about Pod.text
This commit is contained in:
parent
b69b312692
commit
14ba338b1e
|
@ -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…
Reference in New Issue
Block a user