Ejemplo n.º 1
0
def init_env():
    os.environ['AUTH_DOMAIN'] = 'gmail.com'
    os.environ['APPLICATION_ID'] = 'mobicagecloud'
    os.environ['SERVER_NAME'] = 'localhost'
    os.environ['SERVER_PORT'] = '8080'
    os.environ['SERVER_SOFTWARE'] = 'Development Server'
    os.environ["DEFAULT_VERSION_HOSTNAME"] = 'mobicagecloudhr.appspot.com'
    os.environ[
        'APPENGINE_RUNTIME'] = 'python27'  # Needed to make webapp.template load ._internal.django

    if not apiproxy_stub_map.apiproxy.GetStub('user'):
        apiproxy_stub_map.apiproxy.RegisterStub(
            'user', user_service_stub.UserServiceStub())
        apiproxy_stub_map.apiproxy.RegisterStub(
            'datastore_v3',
            datastore_file_stub.DatastoreFileStub('mobicagecloud', '/dev/null',
                                                  '/dev/null'))
        apiproxy_stub_map.apiproxy.RegisterStub('mail',
                                                mail_stub.MailServiceStub())
        apiproxy_stub_map.apiproxy.RegisterStub(
            'blobstore',
            blobstore_stub.BlobstoreServiceStub(
                file_blob_storage.FileBlobStorage('/dev/null',
                                                  'mobicagecloud')))
        apiproxy_stub_map.apiproxy.RegisterStub(
            'memcache', memcache_stub.MemcacheServiceStub())
        apiproxy_stub_map.apiproxy.RegisterStub(
            'images', images_stub.ImagesServiceStub())
        apiproxy_stub_map.apiproxy.RegisterStub(
            'urlfetch', urlfetch_stub.URLFetchServiceStub())
        apiproxy_stub_map.apiproxy.RegisterStub(
            'taskqueue', taskqueue_stub.TaskQueueServiceStub())
Ejemplo n.º 2
0
def setup_stub():
    apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()
    stub = datastore_file_stub.DatastoreFileStub('test',
                                                 '/dev/null',
                                                 '/dev/null',
                                                 trusted=True)
    apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', stub)

    apiproxy_stub_map.apiproxy.RegisterStub(
        'user', user_service_stub.UserServiceStub())

    apiproxy_stub_map.apiproxy.RegisterStub(
        'memcache', memcache_stub.MemcacheServiceStub())

    apiproxy_stub_map.apiproxy.RegisterStub(
        'urlfetch', urlfetch_stub.URLFetchServiceStub())

    apiproxy_stub_map.apiproxy.RegisterStub(
        'taskqueue', taskqueue_stub.TaskQueueServiceStub())

    try:
        apiproxy_stub_map.apiproxy.RegisterStub(
            'images', images_stub.ImagesServiceStub())
    except NameError:
        pass
Ejemplo n.º 3
0
def get_dev_apiproxy():
    _apiproxy = apiproxy_stub_map.APIProxyStubMap()

    _apiproxy.RegisterStub('datastore_v3', datastore_file_stub.DatastoreFileStub(APP_ID, None, None))
    _apiproxy.RegisterStub('user', user_service_stub.UserServiceStub())
    _apiproxy.RegisterStub('urlfetch', urlfetch_stub.URLFetchServiceStub())
    _apiproxy.RegisterStub('mail', mail_stub.MailServiceStub()) 
    _apiproxy.RegisterStub('memcache', memcache_stub.MemcacheServiceStub()) 
    _apiproxy.RegisterStub('taskqueue', taskqueue_stub.TaskQueueServiceStub()) 
    return _apiproxy
Ejemplo n.º 4
0
def setup_stub():
    apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()
    stub = datastore_file_stub.DatastoreFileStub('test', '/dev/null',
                                                 '/dev/null')
    apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', stub)

    apiproxy_stub_map.apiproxy.RegisterStub(
        'user', user_service_stub.UserServiceStub())

    apiproxy_stub_map.apiproxy.RegisterStub(
        'memcache', memcache_stub.MemcacheServiceStub())

    apiproxy_stub_map.apiproxy.RegisterStub(
        'urlfetch', urlfetch_stub.URLFetchServiceStub())

    apiproxy_stub_map.apiproxy.RegisterStub(
        'taskqueue', taskqueue_stub.TaskQueueServiceStub())
Ejemplo n.º 5
0
 def setUp(self, **kwargs):
     super(XmppTest, self).setUp(**kwargs)
     stub = taskqueue_stub.TaskQueueServiceStub()
     self._RegisterStub('taskqueue', self)