diff --git a/trac/tests/functional/testenv.py b/trac/tests/functional/testenv.py
|
a
|
b
|
|
| 53 | 53 | self.htpasswd = os.path.join(self.dirname, "htpasswd") |
| 54 | 54 | self.port = port |
| 55 | 55 | self.pid = None |
| | 56 | self.init() |
| 56 | 57 | self.destroy() |
| 57 | 58 | self.create() |
| 58 | 59 | locale.setlocale(locale.LC_ALL, '') |
| 59 | 60 | |
| | 61 | trac_src = '.' |
| 60 | 62 | dburi = property(lambda x: get_dburi()) |
| 61 | 63 | |
| 62 | 64 | def destroy(self): |
| … |
… |
|
| 71 | 73 | |
| 72 | 74 | repotype = 'svn' |
| 73 | 75 | |
| | 76 | def init(self): |
| | 77 | """ Hook for modifying settings or class attributes before |
| | 78 | any methods are called. """ |
| | 79 | pass |
| | 80 | |
| 74 | 81 | def create_repo(self): |
| 75 | 82 | """Hook for creating the repository.""" |
| 76 | 83 | # The default test environment does not include a source repo |
| … |
… |
|
| 108 | 115 | self._tracadmin('initenv', 'testenv%s' % self.port, |
| 109 | 116 | self.dburi, self.repotype, |
| 110 | 117 | self.repo_path_for_initenv()) |
| 111 | | if call([sys.executable, './contrib/htpasswd.py', "-c", "-b", |
| 112 | | self.htpasswd, "admin", "admin"], close_fds=close_fds, |
| | 118 | if call([sys.executable, |
| | 119 | os.path.join(self.trac_src, 'contrib', 'htpasswd.py'), "-c", |
| | 120 | "-b", self.htpasswd, "admin", "admin"], close_fds=close_fds, |
| 113 | 121 | cwd=self.command_cwd): |
| 114 | 122 | raise Exception('Unable to setup admin password') |
| 115 | 123 | self.adduser('user') |
| … |
… |
|
| 125 | 133 | def adduser(self, user): |
| 126 | 134 | """Add a user to the environment. The password will be set to the |
| 127 | 135 | same as username.""" |
| 128 | | if call([sys.executable, './contrib/htpasswd.py', '-b', self.htpasswd, |
| | 136 | if call([sys.executable, os.path.join(self.trac_src, 'contrib', |
| | 137 | 'htpasswd.py'), '-b', self.htpasswd, |
| 129 | 138 | user, user], close_fds=close_fds, cwd=self.command_cwd): |
| 130 | 139 | raise Exception('Unable to setup password for user "%s"' % user) |
| 131 | 140 | |
| 132 | 141 | def _tracadmin(self, *args): |
| 133 | 142 | """Internal utility method for calling trac-admin""" |
| 134 | | proc = Popen([sys.executable, "./trac/admin/console.py", self.tracdir] |
| | 143 | proc = Popen([sys.executable, os.path.join(self.trac_src, 'trac', |
| | 144 | 'admin', 'console.py'), self.tracdir] |
| 135 | 145 | + list(args), stdout=PIPE, stderr=STDOUT, |
| 136 | 146 | close_fds=close_fds, cwd=self.command_cwd) |
| 137 | 147 | out = proc.communicate()[0] |
| … |
… |
|
| 151 | 161 | "--basic-auth=trac,%s," % self.htpasswd] |
| 152 | 162 | if 'TRAC_TEST_TRACD_OPTIONS' in os.environ: |
| 153 | 163 | options += os.environ['TRAC_TEST_TRACD_OPTIONS'].split() |
| 154 | | server = Popen([exe, "./trac/web/standalone.py"] + options + |
| 155 | | [self.tracdir], |
| | 164 | server = Popen([exe, os.path.join(self.trac_src, 'trac', 'web', |
| | 165 | 'standalone.py')] + options + [self.tracdir], |
| 156 | 166 | stdout=logfile, stderr=logfile, |
| 157 | 167 | close_fds=close_fds, |
| 158 | 168 | cwd=self.command_cwd, |