Created
May 30, 2012 18:56
-
-
Save amalakar/2838282 to your computer and use it in GitHub Desktop.
Test Case for requests Issue #598 Pass json objects as url parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import unittest | |
# Path hack. | |
sys.path.insert(0, os.path.abspath('..')) | |
import requests | |
class TestJsonAsUrlParam(unittest.TestCase): | |
def test_json_as_url_param(self): | |
print requests.__version__ | |
fullurl = 'https://www.googleapis.com/freebase/v1/mqlread?query=%5B%7B%22percentage_alcohol%3E%22%3A+0%2C+%22country%22%3A+null%2C+%22type%22%3A+%22%2Ffood%2Fwine%22%2C+%22name%22%3A+null%2C+%22percentage_alcohol%22%3A+null%7D%5D' | |
r = requests.get(fullurl) | |
self.assertEqual(r.status_code, 200) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment