def setUp(self): config_file = os.path.join(os.path.dirname(__file__), "sync.conf") self.app = make_app({"configuration": "file:" + config_file}).app # set up a test user account self.auth = self.app.auth.backend self.username = '******' self.password = '******' self.auth.create_user(self.username, self.password, "*****@*****.**") self.userid = self.auth.get_user_id(self.username) authz_token = base64.b64encode(self.username + ':' + self.password) self.authorization = 'Basic ' + authz_token
def setUp(self): # loading the app self.appdir, self.config, self.storage, self.auth = initenv() # we don't support other storages for this test assert self.storage.sqluri.split(':/')[0] in ('mysql', 'sqlite') self.sqlfile = self.storage.sqluri.split('sqlite:///')[-1] self.app = TestApp(make_app(self.config)) # adding a user if needed self.user_name = 'test_user_%d' % random.randint(1, 100000) self.password = '******' * 9 self.auth.create_user(self.user_name, self.password, '*****@*****.**') self.user_id = self.auth.get_user_id(self.user_name)
def setUp(self): self.appdir, self.config, self.storage, self.auth = initenv() config_file = os.path.join(os.path.dirname(__file__), "sync.conf") self.app = make_app({"configuration": "file:" + config_file}).app # we don't support other storages for this test self.sql_driver = self.storage.sqluri.split(":/")[0] assert self.sql_driver in ("mysql", "sqlite", "pymysql") # make sure we have the standard collections in place for name in ("client", "crypto", "forms", "history", "key", "meta", "bookmarks", "prefs", "tabs", "passwords"): self.storage.set_collection(_UID, name) self._cleanup_functions = [] # delete the decorator's cached metlog client timed_safe_execute._client = None
def setUp(self): self.appdir, self.config, self.storage, self.auth = initenv() config_file = os.path.join(os.path.dirname(__file__), "sync.conf") self.app = make_app({"configuration": "file:" + config_file}).app # we don't support other storages for this test self.sql_driver = self.storage.sqluri.split(':/')[0] assert self.sql_driver in ('mysql', 'sqlite', 'pymysql') # make sure we have the standard collections in place for name in ('clients', 'crypto', 'forms', 'history', 'keys', 'meta', 'bookmarks', 'prefs', 'tabs', 'passwords'): self.storage.set_collection(_UID, name) self._cleanup_functions = [] # delete the decorator's cached metlog client timed_safe_execute._client = None
def setUp(self): # loading the app self.appdir, self.config, self.storage, self.auth = initenv() # we don't support other storages for this test self.sql_driver = self.storage.sqluri.split(':/')[0] assert self.sql_driver in ('mysql', 'sqlite', 'pymysql') test_remote_url = os.environ.get("TEST_REMOTE") if test_remote_url is not None: self.distant = True test_remote_url_p = urlparse.urlparse(test_remote_url) self.app = TestApp(WSGIProxyApp(test_remote_url), extra_environ={ "HTTP_HOST": test_remote_url_p.netloc, "wsgi.url_scheme": test_remote_url_p.scheme or "http", "SERVER_NAME": test_remote_url_p.hostname, "REMOTE_ADDR": "127.0.0.1", }) else: self.distant = False self.app = TestApp(make_app(self.config)) self._setup_user()
def setUp(self): config_file = os.path.join(os.path.dirname(__file__), "sync.conf") config_dict = {"configuration": "file:" + config_file} self.app = wsgiapp.make_app(config_dict).app
def setUp(self): config_dict = {"configuration": "file:" + BASE_CONFIG_FILE} self.app = wsgiapp.make_app(config_dict).app
def _set_config(self, custom_config, extra_environ={}): config = self.BASE_CONFIG.copy() config.update(custom_config) self.app = wsgiapp.make_app(config).app self.testclient = TestApp(self.app, extra_environ=extra_environ)