diff --git a/wolframalpha/__init__.py b/wolframalpha/__init__.py index 7e271c4..2e2ce87 100644 --- a/wolframalpha/__init__.py +++ b/wolframalpha/__init__.py @@ -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) diff --git a/wolframalpha/test_client.py b/wolframalpha/test_client.py new file mode 100644 index 0000000..0989ff5 --- /dev/null +++ b/wolframalpha/test_client.py @@ -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')