def tearDown(self): # Remove directories for path in self._dirs_to_remove: shutil.rmtree(path, ignore_errors=True) restore_indexes() restore_tags() WStoreSeleniumTestCase.tearDown(self)
def tearDown(self): # Remove directories for path in self._dirs_to_remove: try: files = os.listdir(path) for f in files: file_path = os.path.join(path, f) os.remove(file_path) os.rmdir(path) except: pass restore_indexes() restore_tags() WStoreSeleniumTestCase.tearDown(self)
def tearDown(self): # If the server is still waiting for a call make a # fake call in order to terminate it if self._server.call_received() < self._server.max_request: from urllib2 import urlopen self._server.set_max_request(0) try: url = 'http://localhost:' + unicode(TESTING_PORT) urlopen(url) except: pass path = os.path.join(settings.BASEDIR, 'media/provider__test_offering__1.0') shutil.rmtree(path, ignore_errors=True) WStoreSeleniumTestCase.tearDown(self)
def tearDown(self): if self._server.call_received() < self._server.max_request: from urllib2 import urlopen self._server.set_max_request(0) try: url = 'http://localhost:' + unicode(TESTING_PORT) urlopen(url) except: pass # Remove bills if needed for p in Purchase.objects.all(): for bill in p.bill: path = os.path.join(settings.BASEDIR, bill[1:]) try: os.remove(path) except: pass WStoreSeleniumTestCase.tearDown(self)
def tearDown(self): # If the server is still waiting for a call make a # fake call in order to terminate it if self._server.call_received() < self._server.max_request: from urllib2 import urlopen self._server.set_max_request(0) try: url = 'http://localhost:' + unicode(TESTING_PORT) urlopen(url) except: pass path = os.path.join(settings.BASEDIR, 'media/provider__test_offering__1.0') try: files = os.listdir(path) for f in files: file_path = os.path.join(path, f) os.remove(file_path) os.rmdir(path) except: pass WStoreSeleniumTestCase.tearDown(self)