|
|
|
|
1
|
#!/usr/bin/python
|
1
|
#!/usr/bin/python
|
2
|
|
2
|
|
3
|
-import httplib
|
|
|
|
|
3
|
+import http.client
|
4
|
import operator
|
4
|
import operator
|
5
|
import subprocess
|
5
|
import subprocess
|
6
|
import unittest
|
6
|
import unittest
|
|
|
|
|
47
|
def _get_data(self):
|
47
|
def _get_data(self):
|
48
|
pq = "op=%(op)s&a=%(a)s&b=%(b)s" % self._args
|
48
|
pq = "op=%(op)s&a=%(a)s&b=%(b)s" % self._args
|
49
|
parsed_url = urlparse.urlparse(self._settings['uri'])
|
49
|
parsed_url = urlparse.urlparse(self._settings['uri'])
|
50
|
- conn = httplib.HTTPConnection(parsed_url.hostname)
|
|
|
|
|
50
|
+ conn = http.client.HTTPConnection(parsed_url.hostname)
|
51
|
conn.request("GET", "%s?%s" % (parsed_url.path, pq))
|
51
|
conn.request("GET", "%s?%s" % (parsed_url.path, pq))
|
52
|
resp = conn.getresponse()
|
52
|
resp = conn.getresponse()
|
53
|
assert resp.status == 200
|
53
|
assert resp.status == 200
|