def setUp(self): s = LazySettings(settings_module='kay.tests.regressiontests.badurls_settings') self.app = get_application(settings=s) try: self.client = Client(self.app, BaseResponse) except DeadlineExceededError: pass
def setUp(self): init_recording() app = get_application() self.client = Client(app, BaseResponse) self.consumer_key = "e30e49d63907db14c48c5ad063ff7577b7ab5248" self.consumer_secret = "d06b6c54863ac33d12419dd04f7acb85c696f722" self.access_token = "c02b74809aaccf4972b9bb7059fa28aa91a255a3" self.access_token_secret = "9c676e003b8932ac49d4d3a18467c0b59e3e3fb6"
def setUp(self): s = LazySettings(settings_module='kay.tests.settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) if apiproxy_stub_map.apiproxy\ ._APIProxyStubMap__stub_map.has_key('capability_service'): del(apiproxy_stub_map.apiproxy\ ._APIProxyStubMap__stub_map['capability_service'])
def setUp(self): s = LazySettings( settings_module='kay.tests.regressiontests.badurls_settings') self.app = get_application(settings=s) try: self.client = Client(self.app, BaseResponse) except DeadlineExceededError: pass
def setUp(self): from google.appengine.api import memcache memcache.flush_all() s = LazySettings(settings_module='kay.tests.live_settings_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) live_settings.set("setting.1", "on") live_settings.set("setting.2", "off")
def setUp(self): s = LazySettings(settings_module="kay.tests.regressiontests.server_error_settings") app = get_application(settings=s) self.client = Client(app, BaseResponse) self.client.test_logout() # Suppress logging error messages self._base_logger = logging.getLogger("") self._old_logging_handlers = self._base_logger.handlers self._base_logger.handlers = [NullHandler()]
def setUp(self): s = LazySettings( settings_module='kay.tests.regressiontests.server_error_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) self.client.test_logout() # Suppress logging error messages self._base_logger = logging.getLogger("") self._old_logging_handlers = self._base_logger.handlers self._base_logger.handlers = [NullHandler()]
def setUp(self): try: self.original_user = os.environ['USER_EMAIL'] self.original_is_admin = os.environ['USER_IS_ADMIN'] del os.environ['USER_EMAIL'] del os.environ['USER_IS_ADMIN'] except Exception: pass s = LazySettings(settings_module='kay.tests.google_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) self.client.test_logout()
def setUp(self): s = LazySettings( settings_module='kay.tests.ereporter_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) #self.client.test_logout() # Suppress logging error messages self._base_logger = logging.getLogger("") self._old_logging_handlers = self._base_logger.handlers self._base_logger.handlers = filter( lambda h: not isinstance(h, logging.StreamHandler), self._old_logging_handlers, )
def setUp(self): 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()) s = LazySettings(settings_module="kay.tests.settings") app = get_application(settings=s) self.client = Client(app, BaseResponse) if apiproxy_stub_map.apiproxy._APIProxyStubMap__stub_map.has_key("capability_service"): del (apiproxy_stub_map.apiproxy._APIProxyStubMap__stub_map["capability_service"])
def real_main(): global application global applications server_name = os.environ.get('SERVER_NAME') target_setting = settings.PER_DOMAIN_SETTINGS.get(server_name, None) if target_setting: applications[server_name] = get_application(settings=LazySettings( settings_module=target_setting)) if settings.DEBUG: logging.getLogger().setLevel(logging.DEBUG) if 'SERVER_SOFTWARE' in os.environ and \ os.environ['SERVER_SOFTWARE'].startswith('Dev'): # use our debug.utils with Jinja2 templates import debug.utils sys.modules['werkzeug.debug.utils'] = debug.utils # don't use inspect.getsourcefile because the imp module is empty import inspect inspect.getsourcefile = inspect.getfile # wrap the application from werkzeug import DebuggedApplication global debugged_application global debugged_applications if target_setting: if not debugged_applications.has_key(server_name): debugged_applications[server_name] = applications[server_name] = \ DebuggedApplication(applications[server_name], evalex=True) else: applications[server_name] = debugged_applications[ server_name] else: if debugged_application is None: debugged_application = application = DebuggedApplication( application, evalex=True) else: application = debugged_application else: logging.getLogger().setLevel(logging.INFO) if target_setting: KayHandler().run(applications[server_name]) else: KayHandler().run(application)
def real_main(): global application global applications server_name = os.environ.get('SERVER_NAME') target_setting = settings.PER_DOMAIN_SETTINGS.get(server_name, None) if target_setting: applications[server_name] = get_application( settings=LazySettings(settings_module=target_setting)) if settings.DEBUG: logging.getLogger().setLevel(logging.DEBUG) if 'SERVER_SOFTWARE' in os.environ and \ os.environ['SERVER_SOFTWARE'].startswith('Dev'): # use our debug.utils with Jinja2 templates import debug.utils sys.modules['werkzeug.debug.utils'] = debug.utils # don't use inspect.getsourcefile because the imp module is empty import inspect inspect.getsourcefile = inspect.getfile # wrap the application from werkzeug import DebuggedApplication global debugged_application global debugged_applications if target_setting: if not debugged_applications.has_key(server_name): debugged_applications[server_name] = applications[server_name] = \ DebuggedApplication(applications[server_name], evalex=True) else: applications[server_name] = debugged_applications[server_name] else: if debugged_application is None: debugged_application = application = DebuggedApplication(application, evalex=True) else: application = debugged_application else: logging.getLogger().setLevel(logging.INFO) if target_setting: KayHandler().run(applications[server_name]) else: KayHandler().run(application)
def setUp(self): app = get_application() self.client = Client(app, BaseResponse) self.test_values = { 'date': datetime.datetime(2016, 5, 20, 15, 0), 'title': 'THIS IS TITLE', 'description': 'THIS IS TITLE', } eve = Event( event_date=self.test_values['date'], title=self.test_values['title'], description=self.test_values['description'], ) eve.put() events = Event.all().fetch(100) self.assertEquals(len(events), 1) self.assertEquals(events[0].title, 'THIS IS TITLE') self.event_key = str(events[0].key())
def setUp(self): 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()) s = LazySettings(settings_module='kay.tests.settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) if apiproxy_stub_map.apiproxy\ ._APIProxyStubMap__stub_map.has_key('capability_service'): del(apiproxy_stub_map.apiproxy\ ._APIProxyStubMap__stub_map['capability_service'])
def setUp(self): 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()) s = LazySettings(settings_module='kay.tests.settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) if apiproxy_stub_map.apiproxy\ ._APIProxyStubMap__stub_map.has_key('capability_service'): del(apiproxy_stub_map.apiproxy\ ._APIProxyStubMap__stub_map['capability_service'])
def setUp(self): from google.appengine.api import memcache memcache.flush_all() s = LazySettings(settings_module='kay.tests.appstats_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse)
def setUp(self): from kay.auth import create_new_user s = LazySettings(settings_module='kay.tests.datastore_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) create_new_user("foobar", "password", is_admin=False)
def setUp(self): s = LazySettings(settings_module='kay.tests.decorator_settings') s.DEBUG = True app = get_application(settings=s) self.client = Client(app, BaseResponse)
def setUp(self): s = LazySettings(settings_module='kay.tests.settings') app = get_application(settings=s) self.client = Client(app, BaseResponse)
""" import logging import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) import kay kay.setup() from kay.app import get_application from kay.utils.handlers import KayHandler from kay.conf import (settings, LazySettings) application = get_application() debugged_application = None applications = {} debugged_applications = {} def real_main(): global application global applications server_name = os.environ.get('SERVER_NAME') target_setting = settings.PER_DOMAIN_SETTINGS.get(server_name, None) if target_setting: applications[server_name] = get_application(settings=LazySettings( settings_module=target_setting)) if settings.DEBUG: logging.getLogger().setLevel(logging.DEBUG)
def setUp(self): s = LazySettings(settings_module='kay.tests.google_settings') self.app = get_application(settings=s)
def setUp(self): init_recording() app = get_application() self.client = Client(app, BaseResponse) self.consumer_key = "3db2991a3bd1f2ca292a463744f4136d61b1faa3" self.consumer_secret = "ee49886656eacc1451a1a06ad61d7a8b31448650"
def setUp(self): s = LazySettings(settings_module='kay.tests.cache_test.settings') self.app = get_application(settings=s) self.client = Client(self.app, BaseResponse) memcache.flush_all()
def setUp(self): import os s = LazySettings(settings_module='kay.tests.cookie_session_settings') app = get_application(settings=s) self.client = Client(app, BaseResponse) self.server_name = os.environ['SERVER_NAME']
def setUp(self): init_recording() app = get_application() self.client = Client(app, BaseResponse)
""" import logging import os import sys import kay kay.setup() from kay.app import get_application from kay.utils.handlers import KayHandler from kay.conf import ( settings, LazySettings ) application = get_application() debugged_application = None applications = {} debugged_applications = {} def real_main(): global application global applications server_name = os.environ.get('SERVER_NAME') target_setting = settings.PER_DOMAIN_SETTINGS.get(server_name, None) if target_setting: applications[server_name] = get_application( settings=LazySettings(settings_module=target_setting)) if settings.DEBUG: logging.getLogger().setLevel(logging.DEBUG) if 'SERVER_SOFTWARE' in os.environ and \
def setUp(self): self.client = Client(get_application(), BaseResponse) self.c = self.client