-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
29 lines (24 loc) · 1.11 KB
/
__init__.py
File metadata and controls
29 lines (24 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import unittest
API_KEY = "wFNJekVpDCJtRPFX812pQsJee-gt0zO4X5XmG6wcfSOSlLocxodAXNMbl0_hw3Vl"
SECRET_KEY = "daJDa6_8UcnGMw1yuq9TjoO_PMKukXMo8vEMo7Qv5J-G3SPgrAV0FqFCd0TNjQyG"
RETURN_URL = "http://localhost:8000"
class LinkedInTestBase(unittest.TestCase):
@classmethod
def _create_http_server(cls, result):
import BaseHTTPServer
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
p = self.path.split("?")
params = {}
if len(p) > 1:
import cgi
params = cgi.parse_qs(p[1], True, True)
result.append(params["oauth_verifier"][0])
server_address = ('', 8000)
return BaseHTTPServer.HTTPServer(server_address, MyHandler)
@classmethod
def _init_gae(cls):
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import urlfetch_stub
apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()
apiproxy_stub_map.apiproxy.RegisterStub('urlfetch', urlfetch_stub.URLFetchServiceStub())