def tearDown(self): for repos in self._repomgr.get_real_repositories(): repos.close() self._repomgr.reload_repositories() StorageFactory._clean() self.env.reset_db() if os.path.isdir(self.tmpdir): rmtree(self.tmpdir)
def destroy(self): """Remove all of the test environment data.""" env = EnvironmentStub(path=self.tracdir, destroying=True) env.destroy_db() self.destroy_repo() if os.path.exists(self.dirname): rmtree(self.dirname)
def close(self): if self.tmpdir: rmtree(self.tmpdir) self.tmpdir = None if self.driver: self.driver.quit() self.driver = None if self.proxy_server: self.proxy_server.shutdown() self.proxy_server.server_close() self.proxy_server = None if self.proxy_thread: self.proxy_thread.join() self.proxy_thread = None
def test_deploy(self): dest_path = mkdtemp() shebang = ('#!' + sys.executable).encode('utf-8') try: rv, output = self.execute('deploy %s' % dest_path) self.assertEqual(0, rv, output) self.assertTrue( os.path.isfile( os.path.join(dest_path, 'htdocs', 'common', 'js', 'trac.js'))) self.assertTrue( os.path.isfile( os.path.join(dest_path, 'htdocs', 'common', 'css', 'trac.css'))) for ext in ('cgi', 'fcgi', 'wsgi'): content = read_file( os.path.join(dest_path, 'cgi-bin', 'trac.%s' % ext), 'rb') self.assertIn(shebang, content) self.assertEqual(0, content.index(shebang)) self.assertIn(repr(self.env.path).encode('ascii'), content) finally: rmtree(dest_path)
def tearDown(self): self.env.shutdown() # really closes the db connections rmtree(self.env.path)
def test_no_refs_dir(self): self._git_init(bare=True) rmtree(os.path.join(self.repos_path, 'refs')) self._dbrepoprov.add_repository('gitrepos', self.repos_path, 'git') self.assertRaises(TracError, self._repomgr.get_repository, 'gitrepos')
def tearDown(self): self.env.shutdown() rmtree(self.projects_base)
def tearDown(self): ComponentMeta._components = self._orig['ComponentMeta._components'] ComponentMeta._registry = self._orig['ComponentMeta._registry'] ConfigSection.registry = self._orig['ConfigSection.registry'] Option.registry = self._orig['Option.registry'] rmtree(self.tmpdir)
def image_teardown(tc): rmtree(os.path.join(tc.env.path, 'files')) os.rmdir(tc.env.path) # there was only 'files' below tc.env.path tc.env.reset_db()
def tearDown(self): rmtree(self.dir)
def tearDown(self): rmtree(self.env_path)
def tearDown(self): rmtree(self.tmpdir)
def tearDown(self): RepositoryManager(self.env).reload_repositories() StorageFactory._clean() self.env.reset_db() if os.path.isdir(self.repos_path): rmtree(self.repos_path)
def tearDown(self): if self.src_env: self.src_env.shutdown() if self.dst_env: self.dst_env.shutdown() rmtree(self.path)
def tearDownClass(cls): cls.env.shutdown() rmtree(cls.env.path) cls.devnull.close() sys.stdout = cls.stdout sys.stderr = cls.stderr
def tearDown(self): sys.path.remove(self.dir) rmtree(self.dir)
def tearDown(self): if self.env: self.env.shutdown() rmtree(self.env_path)
def tearDown(self): self.env.reset_db() if os.path.isdir(self.repos_path): rmtree(self.repos_path)
def tearDown(self): self.env.shutdown() rmtree(self.env.path)
def tearDown(self): if self.req and self.req._response: self.req._response.close() rmtree(self.dir)
def tearDown(self): if os.path.isfile(os.path.join(self.env_path, 'VERSION')): self.admin.env.shutdown() rmtree(self.parent_dir)