MCPcopy
hub / github.com/gitless-vcs/gitless / test_sync_changes

Method test_sync_changes

gitless/tests/test_core.py:949–970  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

947 self.remote = self.repo.remotes['remote']
948
949 def test_sync_changes(self):
950 master_head_before = self.remote.lookup_branch('master').head
951 remote_branch = self.remote.lookup_branch(REMOTE_BRANCH)
952 remote_branch_head_before = remote_branch.head
953
954 current_b = self.repo.current_branch
955 # It is not a ff so it should fail
956 self.assertRaises(core.GlError, current_b.publish, remote_branch)
957 # Get the changes
958 git.rebase(remote_branch)
959 # Retry (this time it should work)
960 current_b.publish(remote_branch)
961
962 self.assertItemsEqual(
963 ['master', REMOTE_BRANCH], self.remote.listall_branches())
964 self.assertEqual(
965 master_head_before.id, self.remote.lookup_branch('master').head.id)
966
967 self.assertNotEqual(
968 remote_branch_head_before.id,
969 remote_branch.head.id)
970 self.assertEqual(current_b.head.id, remote_branch.head.id)

Callers

nothing calls this directly

Calls 4

publishMethod · 0.80
assertItemsEqualMethod · 0.80
lookup_branchMethod · 0.45
listall_branchesMethod · 0.45

Tested by

no test coverage detected