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)
示例#2
0
    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)
示例#3
0
 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):
     self.driver.close()
     couchdb_wrapper = CouchHttpWrapper("localhost")
     json_data = couchdb_wrapper.get("/hni_testorg_coj00001/_design/submissionlog/_view/submissionlog?reduce=false")
     json_parsed_data = json.load(json_data)
     for data in range(json_parsed_data["total_rows"]):
         id = json_parsed_data["rows"][data]["id"]
         rev = json_parsed_data["rows"][data]["value"]["_rev"]
         couchdb_wrapper.delete("/hni_testorg_coj00001/"+id+"?rev="+rev)
示例#5
0
 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):
     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
示例#8
0
 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()
示例#9
0
 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()