Mercurial > kallithea
comparison rhodecode/tests/functional/test_files.py @ 2318:058e2743e7b7 beta
fixes issue #455 Creating an archive generates an exception on Windows
- reverted the FileIter implementation as it had the same issue on windows and
probably on unix as ref #448
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 20 May 2012 14:41:03 +0200 |
parents | 3c1d991755df |
children | 86aa4f1f130b |
comparison
equal
deleted
inserted
replaced
2317:c4d8ed624728 | 2318:058e2743e7b7 |
---|---|
198 repo_name=HG_REPO, | 198 repo_name=HG_REPO, |
199 fname=fname)) | 199 fname=fname)) |
200 | 200 |
201 self.assertEqual(response.status, '200 OK') | 201 self.assertEqual(response.status, '200 OK') |
202 heads = [ | 202 heads = [ |
203 ('Content-Type', 'text/html; charset=utf-8'), | 203 ('Pragma', 'no-cache'), |
204 ('Content-Length', '0'), ('Pragma', 'no-cache'), | 204 ('Cache-Control', 'no-cache'), |
205 ('Cache-Control', 'no-cache') | 205 ('Content-Disposition', 'attachment; filename=%s' % filename), |
206 ('Content-Type', '%s; charset=utf-8' % info[0]), | |
206 ] | 207 ] |
207 self.assertEqual(response.response._headers.items(), heads) | 208 self.assertEqual(response.response._headers.items(), heads) |
208 | 209 |
209 def test_archival_wrong_ext(self): | 210 def test_archival_wrong_ext(self): |
210 self.log_user() | 211 self.log_user() |
211 | 212 |
212 for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: | 213 for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: |
213 fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext | 214 fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext |
214 | 215 |
215 response = self.app.get(url(controller='files', action='archivefile', | 216 response = self.app.get(url(controller='files', |
217 action='archivefile', | |
216 repo_name=HG_REPO, | 218 repo_name=HG_REPO, |
217 fname=fname)) | 219 fname=fname)) |
218 response.mustcontain('Unknown archive type') | 220 response.mustcontain('Unknown archive type') |
219 | 221 |
220 def test_archival_wrong_revision(self): | 222 def test_archival_wrong_revision(self): |
221 self.log_user() | 223 self.log_user() |
222 | 224 |
223 for rev in ['00x000000', 'tar', 'wrong', '@##$@$424213232', '232dffcd']: | 225 for rev in ['00x000000', 'tar', 'wrong', '@##$@$42413232', '232dffcd']: |
224 fname = '%s.zip' % rev | 226 fname = '%s.zip' % rev |
225 | 227 |
226 response = self.app.get(url(controller='files', action='archivefile', | 228 response = self.app.get(url(controller='files', |
229 action='archivefile', | |
227 repo_name=HG_REPO, | 230 repo_name=HG_REPO, |
228 fname=fname)) | 231 fname=fname)) |
229 response.mustcontain('Unknown revision') | 232 response.mustcontain('Unknown revision') |
230 | 233 |
231 #========================================================================== | 234 #========================================================================== |