def tearDown(self): """ Need to explicitely invoke destruction on all bases. """ self.db2.delete_database() SoledadWithCouchServerMixin.tearDown(self) tests.TestCaseWithServer.tearDown(self)
def setUp(self): SoledadWithCouchServerMixin.setUp(self) self.startTwistedServer() # config info self.db1_file = os.path.join(self.tempdir, "db1.u1db") os.unlink(self.db1_file) self.db_pass = DBPASS self.email = ADDRESS # get a random prefix for each test, so we do not mess with # concurrency during initialization and shutting down of # each local db. self.rand_prefix = ''.join( map(lambda x: random.choice(string.ascii_letters), range(6))) # open test dbs: db1 will be the local sqlcipher db (which # instantiates a syncdb). We use the self._soledad instance that was # already created on some setUp method. import binascii tohex = binascii.b2a_hex key = tohex(self._soledad.secrets.get_local_storage_key()) sync_db_key = tohex(self._soledad.secrets.get_sync_db_key()) dbpath = self._soledad._local_db_path self.opts = SQLCipherOptions( dbpath, key, is_raw_key=True, create=False, defer_encryption=True, sync_db_key=sync_db_key) self.db1 = SQLCipherDatabase(self.opts) self.db2 = self.request_state._create_database('test')
def setUp(self): tests.TestCaseWithServer.setUp(self) self.main_test_class = test_remote_sync_target.TestRemoteSyncTargets SoledadWithCouchServerMixin.setUp(self) self.startServer() self.db1 = make_sqlcipher_database_for_test(self, 'test1') self.db2 = self.request_state._create_database('test2')
def setUp(self): SoledadWithCouchServerMixin.setUp(self) # config info self.db1_file = os.path.join(self.tempdir, "db1.u1db") os.unlink(self.db1_file) self.db_pass = DBPASS self.email = ADDRESS # get a random prefix for each test, so we do not mess with # concurrency during initialization and shutting down of # each local db. self.rand_prefix = ''.join( map(lambda x: random.choice(string.ascii_letters), range(6))) # open test dbs: db1 will be the local sqlcipher db (which # instantiates a syncdb). We use the self._soledad instance that was # already created on some setUp method. import binascii tohex = binascii.b2a_hex key = tohex(self._soledad.secrets.get_local_storage_key()) sync_db_key = tohex(self._soledad.secrets.get_sync_db_key()) dbpath = self._soledad._local_db_path self.opts = SQLCipherOptions(dbpath, key, is_raw_key=True, create=False, defer_encryption=True, sync_db_key=sync_db_key) self.db1 = SQLCipherDatabase(self.opts) self.db2 = couch.CouchDatabase.open_database(urljoin( 'http://localhost:' + str(self.wrapper.port), 'test'), create=True, ensure_ddocs=True)
def tearDown(self): self.db1.close() self.db2.close() self._soledad.close() # XXX should not access "private" attrs shutil.rmtree(os.path.dirname(self._soledad._local_db_path)) SoledadWithCouchServerMixin.tearDown(self)
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ SoledadWithCouchServerMixin.setUp(self) self.startTwistedServer() self.db = self.make_database_for_test(self, 'test1') self.db2 = self.request_state._create_database(replica_uid='test')
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ SoledadWithCouchServerMixin.setUp(self) self.startTwistedServer() self.db = self.make_database_for_test(self, "test1") self.db2 = couch.CouchDatabase.open_database( urljoin("http://localhost:" + str(self.wrapper.port), "test"), create=True, ensure_ddocs=True )
def setUp(self): SoledadWithCouchServerMixin.setUp(self) creds = { 'token': { 'uuid': 'user-uuid', 'token': 'auth-token', } } self.target = target.SoledadHTTPSyncTarget(self.couch_url, uuid4().hex, creds, self._soledad._crypto, None)
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ SoledadWithCouchServerMixin.setUp(self) self.startTwistedServer() self.db = self.make_database_for_test(self, 'test1') self.db2 = couch.CouchDatabase.open_database(urljoin( 'http://localhost:' + str(self.wrapper.port), 'test'), create=True, ensure_ddocs=True)
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ tests.TestCaseWithServer.setUp(self) self.main_test_class = test_sync.TestDbSync SoledadWithCouchServerMixin.setUp(self) self.startServer() self.db2 = couch.CouchDatabase.open_database(urljoin( 'http://localhost:' + str(self.wrapper.port), 'test'), create=True, ensure_ddocs=True)
def setUp(self): SoledadWithCouchServerMixin.setUp(self) creds = {'token': { 'uuid': 'user-uuid', 'token': 'auth-token', }} self.target = target.SoledadHTTPSyncTarget( self.couch_url, uuid4().hex, creds, self._soledad._crypto, None)
def setUp(self): SoledadWithCouchServerMixin.setUp(self) self._couch_url = 'http://localhost:' + str(self.wrapper.port) creds = {'token': { 'uuid': 'user-uuid', 'token': 'auth-token', }} self.target = target.SoledadHTTPSyncTarget( self._couch_url, uuid4().hex, creds, self._soledad._crypto, None)
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ tests.TestCaseWithServer.setUp(self) self.main_test_class = test_sync.TestDbSync SoledadWithCouchServerMixin.setUp(self) self.startServer() self.db2 = couch.CouchDatabase.open_database( urljoin( 'http://localhost:' + str(self.wrapper.port), 'test'), create=True, ensure_ddocs=True)
def tearDown(self): """ Need to explicitely invoke destruction on all bases. """ dbsyncer = getattr(self, 'dbsyncer', None) if dbsyncer: dbsyncer.close() self.db1.close() self.db2.close() self._soledad.close() # XXX should not access "private" attrs shutil.rmtree(os.path.dirname(self._soledad._local_db_path)) SoledadWithCouchServerMixin.tearDown(self)
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ SoledadWithCouchServerMixin.setUp(self) self.server = self.server_thread = None self.startServer() self.syncer = None # config info self.db1_file = os.path.join(self.tempdir, "db1.u1db") os.unlink(self.db1_file) self.db_pass = DBPASS self.email = ADDRESS # get a random prefix for each test, so we do not mess with # concurrency during initialization and shutting down of # each local db. self.rand_prefix = ''.join( map(lambda x: random.choice(string.ascii_letters), range(6))) # open test dbs: db1 will be the local sqlcipher db (which # instantiates a syncdb). We use the self._soledad instance that was # already created on some setUp method. import binascii tohex = binascii.b2a_hex key = tohex(self._soledad.secrets.get_local_storage_key()) sync_db_key = tohex(self._soledad.secrets.get_sync_db_key()) dbpath = self._soledad._local_db_path self.opts = SQLCipherOptions( dbpath, key, is_raw_key=True, create=False, defer_encryption=True, sync_db_key=sync_db_key) self.db1 = SQLCipherDatabase(self.opts) self.db2 = couch.CouchDatabase.open_database( urljoin( 'http://localhost:' + str(self.wrapper.port), 'test'), create=True, ensure_ddocs=True)
def setUp(self): """ Need to explicitely invoke inicialization on all bases. """ SoledadWithCouchServerMixin.setUp(self) self.server = self.server_thread = None self.startTwistedServer() self.syncer = None # config info self.db1_file = os.path.join(self.tempdir, "db1.u1db") os.unlink(self.db1_file) self.db_pass = DBPASS self.email = ADDRESS # get a random prefix for each test, so we do not mess with # concurrency during initialization and shutting down of # each local db. self.rand_prefix = ''.join( map(lambda x: random.choice(string.ascii_letters), range(6))) # open test dbs: db1 will be the local sqlcipher db (which # instantiates a syncdb). We use the self._soledad instance that was # already created on some setUp method. import binascii tohex = binascii.b2a_hex key = tohex(self._soledad.secrets.get_local_storage_key()) sync_db_key = tohex(self._soledad.secrets.get_sync_db_key()) dbpath = self._soledad._local_db_path self.opts = SQLCipherOptions(dbpath, key, is_raw_key=True, create=False, defer_encryption=True, sync_db_key=sync_db_key) self.db1 = SQLCipherDatabase(self.opts) self.db2 = self.request_state._create_database(replica_uid='test')
def tearDown(self): """ Need to explicitely invoke destruction on all bases. """ SoledadWithCouchServerMixin.tearDown(self)
def tearDown(self): # db2, _ = self.request_state.ensure_database('test2') self.delete_db(self.db2._dbname) self.db1.close() SoledadWithCouchServerMixin.tearDown(self) TestWithScenarios.tearDown(self)
def setUp(self): self.main_test_class = test_sync.TestDbSync SoledadWithCouchServerMixin.setUp(self)
def tearDown(self): SoledadWithCouchServerMixin.tearDown(self) tests.TestCaseWithServer.tearDown(self) db, _ = self.request_state.ensure_database('test2') db.delete_database()
def setUp(self): self.main_test_class = test_sync.DatabaseSyncTargetTests SoledadWithCouchServerMixin.setUp(self)
def setUp(self): tests.TestCaseWithServer.setUp(self) self.other_changes = [] SoledadWithCouchServerMixin.setUp(self) self.db, self.st = make_local_db_and_soledad_target(self)
def tearDown(self): self.target.close() SoledadWithCouchServerMixin.tearDown(self)
def setUp(self): TestWithScenarios.setUp(self) SoledadWithCouchServerMixin.setUp(self) self.startTwistedServer() self.db1 = make_sqlcipher_database_for_test(self, 'test1') self.db2 = self.request_state._create_database('test')
def tearDown(self): self.db.close() self.st.close() tests.TestCaseWithServer.tearDown(self) SoledadWithCouchServerMixin.tearDown(self)