Added test

This commit is contained in:
Jason R. Coombs 2012-10-03 18:26:58 -04:00
parent c1d9023bd3
commit 772ce9b34d
2 changed files with 10 additions and 1 deletions

View File

@ -23,5 +23,6 @@ class Client(object):
))
url = 'http://api.wolframalpha.com/v2/query?' + query
resp = urllib2.urlopen(url)
assert resp.headers['Content-Type'] == 'application/xml'
assert resp.headers.gettype() == 'text/xml'
assert resp.headers.getparam('charset') == 'utf-8'
return Result(resp)

View File

@ -0,0 +1,8 @@
import wolframalpha
app_id = 'Q59EW4-7K8AHE858R'
"App ID for testing this project. Please don't use for other apps."
def test_basic():
client = wolframalpha.Client(app_id)
client.query('30 deg C in deg F')