Commit 4b617670 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Test for archive production

This will give us the means to test heptapod#204,
hence also omnibus-heptapod#12, since archive production
will be done by HGitaly.
parent 1899b83c14c3
Pipeline #11788 waiting for manual action with stage
......@@ -4,6 +4,7 @@ from selenium.common.exceptions import (
from import WebDriverWait
import tarfile
from .utils import (
......@@ -416,3 +417,32 @@ def test_external_user_can_create_project(test_group, external_user):
# ugly hack until we can just pass a different user
project.owner = 'root'
def test_archive(public_project, tmpdir):
repo_path = tmpdir.join('repo1')
repo = LocalRepo.init(repo_path,
repo.hg('commit', '-Am', "Commit 0")
node = repo.node('.')
# python 3.9 apparently has a nicer syntax for multi-line with statements
# (not worth requiring it right away, of course)
with public_project.get_archive('branch/default') as arch_file, \ as tarf:
toc = tarf.getnames()
main_dir = toc[0].split('/', 1)[0]
assert set(toc) == {main_dir + '/.hg_archival.txt',
main_dir + '/foo'}
extract_dir = tmpdir.join('extract')
metadata_lines = extract_dir.join(main_dir,
assert 'node: %s\n' % node in metadata_lines
assert extract_dir.join(main_dir, 'foo').read() == 'archived'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment