def tearDown(self): import sys exception_info = sys.exc_info() if exception_info != (None, None, None): import os if not os.path.exists("screenshots"): os.mkdir("screenshots") self.driver.get_screenshot_as_file( "screenshots/screenshot-%s-%s.png" % (self.__class__.__name__, self._testMethodName)) try: if self.email is not None: email = self.email dbmanager = DatabaseManager() dbname = dbmanager.delete_organization_all_details( email.lower()) couchwrapper = CouchHttpWrapper() couchwrapper.deleteDb(dbname) except TypeError as e: pass teardown_driver(self.driver)
def tearDownClass(cls): if cls.email is not None: dbmanager = DatabaseManager() dbname = dbmanager.delete_organization_all_details(cls.email.lower()) couchwrapper = CouchHttpWrapper() couchwrapper.deleteDb(dbname) teardown_driver(cls.driver)
def export_test_data_to_couch(self): http_wrapper = CouchHttpWrapper('localhost', '5984') http_wrapper.deleteDb(self.DATA_STORE) http_wrapper.createDb(self.DATA_STORE) test_data_dir = os.path.join(os.path.dirname(__file__), '../../testdata/') fp = open(test_data_dir + 'functional_test_data.json') http_wrapper.saveBulkDoc(self.DATA_STORE, fp.read()) fp.close()
def tearDown(self): if self.email is not None: dbmanager = DatabaseManager() dbname = dbmanager.delete_organization_all_details( self.email.lower()) couchwrapper = CouchHttpWrapper("localhost") couchwrapper.deleteDb(dbname) super(TestActivateAccount, self).tearDown()
def tearDown(self): try: self.driver.quit() email = self.email dbmanager = DatabaseManager() dbname = dbmanager.delete_organization_all_details(email) couchwrapper = CouchHttpWrapper("localhost") couchwrapper.deleteDb(dbname) except TypeError as e: pass
def tearDown(self): teardown_driver(self.driver) try: for email in self.emails: dbmanager = DatabaseManager() dbname = dbmanager.delete_organization_all_details(email) couchwrapper = CouchHttpWrapper() couchwrapper.deleteDb(dbname) pass except TypeError as e: pass