Esempio n. 1
0
 def setUp(self):
     APITestCase.setUp(self)
     # these tests may change a .ini file - so we take care not to
     # crunch a *real* one!
     # This is the cfg file the api uses.
     self.cfg_file = None
     dbname = self.config.couches["local"]["name"]
     cfg_file = os.path.expanduser("~/." + dbname)
     self.failIf(os.path.exists(cfg_file), "Can't run this test while %r exists" % (cfg_file,))
     self.cfg_file = cfg_file
 def prepare_test_db(self, config):
     _ = yield APITestCase.prepare_test_db(self, config)
     # add our test extension(s).
     _ = yield self.doc_model.create_schema_items([self.extension])
Esempio n. 3
0
 def tearDown(self):
     APITestCase.tearDown(self)
     if self.cfg_file is not None and os.path.exists(self.cfg_file):
         os.remove(self.cfg_file)