Beispiel #1
0
 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)
Beispiel #2
0
    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)
Beispiel #3
0
 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
Beispiel #4
0
 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)
Beispiel #5
0
 def tearDown(self):
     self.env.shutdown()  # really closes the db connections
     rmtree(self.env.path)
Beispiel #6
0
 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')
Beispiel #7
0
 def tearDown(self):
     self.env.shutdown()
     rmtree(self.projects_base)
Beispiel #8
0
 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)
Beispiel #9
0
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()
Beispiel #10
0
 def tearDown(self):
     rmtree(self.dir)
Beispiel #11
0
 def tearDown(self):
     rmtree(self.env_path)
Beispiel #12
0
 def tearDown(self):
     rmtree(self.tmpdir)
Beispiel #13
0
 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)
Beispiel #14
0
 def tearDown(self):
     if self.src_env:
         self.src_env.shutdown()
     if self.dst_env:
         self.dst_env.shutdown()
     rmtree(self.path)
Beispiel #15
0
 def tearDownClass(cls):
     cls.env.shutdown()
     rmtree(cls.env.path)
     cls.devnull.close()
     sys.stdout = cls.stdout
     sys.stderr = cls.stderr
Beispiel #16
0
 def tearDown(self):
     sys.path.remove(self.dir)
     rmtree(self.dir)
Beispiel #17
0
 def tearDown(self):
     if self.env:
         self.env.shutdown()
     rmtree(self.env_path)
Beispiel #18
0
 def tearDown(self):
     self.env.reset_db()
     if os.path.isdir(self.repos_path):
         rmtree(self.repos_path)
Beispiel #19
0
 def tearDown(self):
     self.env.shutdown()
     rmtree(self.env.path)
Beispiel #20
0
 def tearDown(self):
     if self.req and self.req._response:
         self.req._response.close()
     rmtree(self.dir)
Beispiel #21
0
 def tearDown(self):
     if os.path.isfile(os.path.join(self.env_path, 'VERSION')):
         self.admin.env.shutdown()
     rmtree(self.parent_dir)