Skip to content

Commit

Permalink
Change branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Dick committed Oct 10, 2023
1 parent c1225ab commit 69ca729
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion perfact/zodbsync/tests/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self):
self.path = tempfile.mkdtemp()
commands = [
['init'],
['branch', '-m', 'main'],
['branch', '-m', 'autotest'],
['config', 'user.email', '[email protected]'],
['config', 'user.name', 'testrepo'],
]
Expand Down
28 changes: 15 additions & 13 deletions perfact/zodbsync/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def envreset(self, request):
cmds = [
'reset --hard',
'clean -dfx',
'checkout main',
'checkout autotest',
'reset --hard {}'.format(self.initial_commit),
]
for cmd in cmds:
Expand All @@ -113,7 +113,7 @@ def envreset(self, request):
for line in output.strip().split('\n'):
commit, refname = line.split()
refname = refname[len('refs/heads/'):]
if refname != 'main':
if refname != 'autotest':
self.gitrun('branch', '-D', refname)

self.run('playback', '--skip-errors', '/')
Expand Down Expand Up @@ -726,7 +726,7 @@ def test_reset(self):
with open(path, 'w') as f:
f.writelines(lines)
self.gitrun('commit', '-a', '-m', 'Change title')
self.gitrun('checkout', 'main')
self.gitrun('checkout', 'autotest')
self.run('reset', 'second')
assert self.app.index_html.title == 'test'

Expand All @@ -744,11 +744,11 @@ def test_checkout(self):
Switch to another branch
"""
self.run('checkout', '-b', 'other')
# This switches back to main, but with a change
# This switches back to autotest, but with a change
self.test_reset()
self.run('checkout', 'other')
assert self.app.index_html.title != 'test'
self.run('checkout', 'main')
self.run('checkout', 'autotest')
assert self.app.index_html.title == 'test'

def test_exec_checkout(self):
Expand Down Expand Up @@ -993,8 +993,8 @@ def test_watch_structure_changes_and_playback_deleted_folder(self, conn):
def test_commit_on_branch_and_exec_merge(self):
'''
change to a git feature branch and create a
structure there, commit it and change back to the main branch
on main branch check if changes from feature arent existent,
structure there, commit it and change back to the autotest branch
on autotest branch check if changes from feature arent existent,
then merge feature branch and check if changes have been applied
correctly
'''
Expand All @@ -1012,8 +1012,8 @@ def test_commit_on_branch_and_exec_merge(self):
self.gitrun('add', '-A')
self.gitrun('commit', '-m', 'test case 3')

# checkout to main and check that changes are not yet existent
self.run('exec', 'git checkout main')
# checkout to autotest and check that changes are not yet existent
self.run('exec', 'git checkout autotest')
assert not os.path.isfile(self.meta_file_path(folder_1, s_folder_1))
assert folder_1 not in self.app.objectIds()

Expand Down Expand Up @@ -1058,11 +1058,13 @@ def test_failing_exec_commands(self):
with pytest.raises(subprocess.CalledProcessError):
self.run('exec', 'cherry-pick ThisIsDefinitelyNoCommit')

def test_create_multiple_commits_on_branch_and_pick_single_on_main(self):
def test_create_multiple_commits_on_branch_and_pick_single_on_autotest(
self
):
"""
create a feature branch on which
two changes will be commited to one commit each
change back to the main branch and use pick
change back to the autotest branch and use pick
to get the changes of that last commit
make sure only the last changes are present
"""
Expand All @@ -1089,8 +1091,8 @@ def test_create_multiple_commits_on_branch_and_pick_single_on_main(self):

commit = self.get_head_id()

# checkout main and check both changes aren't existent
self.run('exec', 'git checkout main')
# checkout autotest and check both changes aren't existent
self.run('exec', 'git checkout autotest')
assert not os.path.isfile(self.meta_file_path(folder_1))
assert folder_1 not in self.app.objectIds()
assert not os.path.isfile(self.meta_file_path(folder_2))
Expand Down

0 comments on commit 69ca729

Please sign in to comment.