Show More
@@ -72,6 +72,7 b' def route_path(name, params=None, **kwar' | |||
|
72 | 72 | 'repo_files_edit_file': '/{repo_name}/edit_file/{commit_id}/{f_path}', |
|
73 | 73 | 'repo_files_update_file': '/{repo_name}/update_file/{commit_id}/{f_path}', |
|
74 | 74 | 'repo_files_add_file': '/{repo_name}/add_file/{commit_id}/{f_path}', |
|
75 | 'repo_files_upload_file': '/{repo_name}/upload_file/{commit_id}/{f_path}', | |
|
75 | 76 | 'repo_files_create_file': '/{repo_name}/create_file/{commit_id}/{f_path}', |
|
76 | 77 | 'repo_nodetree_full': '/{repo_name}/nodetree_full/{commit_id}/{f_path}', |
|
77 | 78 | 'repo_nodetree_full:default_path': '/{repo_name}/nodetree_full/{commit_id}/', |
@@ -564,7 +565,31 b' class TestRepositoryArchival(object):' | |||
|
564 | 565 | ] |
|
565 | 566 | |
|
566 | 567 | for header in headers: |
|
567 | assert header in response.headers.items() | |
|
568 | assert header in list(response.headers.items()) | |
|
569 | ||
|
570 | def test_archival_at_path(self, backend): | |
|
571 | backend.enable_downloads() | |
|
572 | commit = backend.repo.get_commit(commit_idx=190) | |
|
573 | at_path = 'vcs' | |
|
574 | ||
|
575 | for a_type, content_type, extension in settings.ARCHIVE_SPECS: | |
|
576 | path_sha = get_path_sha(at_path) | |
|
577 | filename = get_archive_name(backend.repo_name, commit_sha=commit.short_id, ext=extension, path_sha=path_sha) | |
|
578 | ||
|
579 | fname = commit.raw_id + extension | |
|
580 | response = self.app.get( | |
|
581 | route_path('repo_archivefile', | |
|
582 | repo_name=backend.repo_name, | |
|
583 | fname=fname, params={'at_path': at_path})) | |
|
584 | ||
|
585 | assert response.status == '200 OK' | |
|
586 | headers = [ | |
|
587 | ('Content-Disposition', 'attachment; filename=%s' % filename), | |
|
588 | ('Content-Type', '%s' % content_type), | |
|
589 | ] | |
|
590 | ||
|
591 | for header in headers: | |
|
592 | assert header in list(response.headers.items()) | |
|
568 | 593 | |
|
569 | 594 | @pytest.mark.parametrize('arch_ext',[ |
|
570 | 595 | 'tar', 'rar', 'x', '..ax', '.zipz', 'tar.gz.tar']) |
@@ -315,7 +315,7 b' class RepoFilesView(RepoAppView):' | |||
|
315 | 315 | |
|
316 | 316 | @region.conditional_cache_on_arguments(namespace=cache_namespace_uid, condition=cache_on) |
|
317 | 317 | def compute_file_tree(_name_hash, _repo_id, _commit_id, _f_path, _full_load, _at_rev): |
|
318 |
log.debug('Generating cached file tree at |
|
|
318 | log.debug('Generating cached file tree at for repo_id: %s, %s, %s', | |
|
319 | 319 | _repo_id, _commit_id, _f_path) |
|
320 | 320 | |
|
321 | 321 | c.full_load = _full_load |
@@ -133,8 +133,9 b' class TestArchives(BackendTestMixin):' | |||
|
133 | 133 | archive_node = tmp_path / 'archive-node' |
|
134 | 134 | archive_node.touch() |
|
135 | 135 | |
|
136 |
archive_lnk = self.tip.archive_repo( |
|
|
137 | archive_dir_name='repo', write_metadata=True, cache_config=d_cache_config) | |
|
136 | archive_lnk = self.tip.archive_repo( | |
|
137 | str(archive_node), kind='zip', | |
|
138 | archive_dir_name='repo', write_metadata=True, cache_config=d_cache_config) | |
|
138 | 139 | |
|
139 | 140 | zip_file = zipfile.ZipFile(str(archive_lnk)) |
|
140 | 141 | metafile = zip_file.read('repo/.archival.txt') |
General Comments 0
You need to be logged in to leave comments.
Login now