Read about our upcoming Code of Conduct on this issue

Commit f19e0fe9 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

push_basic: split out the initial push

it will be reused
parent 2107a60432af
......@@ -15,14 +15,9 @@ from .utils.project import (
parametrize = pytest.mark.parametrize
def test_push_basic(test_project, tmpdir):
"""
Push two changesets, one being a draft, confirm their arrival and phases
"""
repo_path = tmpdir.join('repo1')
url = test_project.owner_basic_auth_url
def prepare_simple_repo(proj, repo_path):
repo = LocalRepo.init(repo_path, default_url=proj.owner_basic_auth_url)
repo = LocalRepo.init(repo_path)
repo_path.join('foo').write('foo0')
repo.hg('commit', '-Am', "Commit 0")
repo.hg('phase', '-p', ".")
......@@ -30,19 +25,27 @@ def test_push_basic(test_project, tmpdir):
repo_path.join('foo').write('foo1')
repo.hg('commit', '-Am', "Commit 1")
repo.hg('push', url)
repo.hg('push')
return repo
def test_push_basic(test_project, tmpdir):
"""
Push two changesets, one being a draft, confirm their arrival and phases
"""
repo = prepare_simple_repo(test_project, tmpdir.join('repo1'))
# let's control what GitLab really sees
assert test_project.api_branch_titles() == {
'branch/default': 'Commit 0',
'topic/default/zetop': 'Commit 1',
}
url = test_project.owner_basic_auth_url
clone = LocalRepo.clone(url, tmpdir.join('repo2'))
log = clone.hg('log', '-T', '{desc}:{phase}:{topic}\n')
assert log.splitlines() == ['Commit 1:draft:zetop', 'Commit 0:public:']
repo_path.join('foo').write('foo2')
repo.path.join('foo').write('foo2')
repo.hg('commit', '-Am', "Commit 2")
repo.hg('push', url)
......
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