def setUp(self): # The following snippet comes from BaseLeapTest.setUpClass, but we # repeat it here because twisted.trial does not work with # setUpClass/tearDownClass. self.home = self.tempdir # config info self.db1_file = os.path.join(self.tempdir, "db1.u1db") self.db2_file = os.path.join(self.tempdir, "db2.u1db") self.email = ADDRESS # open test dbs self._db1 = l2db.open(self.db1_file, create=True, document_factory=SoledadDocument) self._db2 = l2db.open(self.db2_file, create=True, document_factory=SoledadDocument) # 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))) # initialize soledad by hand so we can control keys # XXX check if this soledad is actually used self._soledad = self._soledad_instance(prefix=self.rand_prefix, user=self.email)
def setUp(self): # The following snippet comes from BaseLeapTest.setUpClass, but we # repeat it here because twisted.trial does not work with # setUpClass/tearDownClass. self.home = self.tempdir # config info self.db1_file = os.path.join(self.tempdir, "db1.u1db") self.db2_file = os.path.join(self.tempdir, "db2.u1db") self.email = ADDRESS # open test dbs self._db1 = l2db.open(self.db1_file, create=True, document_factory=SoledadDocument) self._db2 = l2db.open(self.db2_file, create=True, document_factory=SoledadDocument) # 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))) # initialize soledad by hand so we can control keys # XXX check if this soledad is actually used self._soledad = self._soledad_instance( prefix=self.rand_prefix, user=self.email)