code
stringlengths
3
6.57k
apply_patch(self, p)
Exception('failed')
WatchlistsMock(object)
__init__(self, _)
GetWatchersForPaths(_)
CodereviewSettingsFileMock(object)
__init__(self)
read(self)
AuthenticatorMock(object)
__init__(self, *_args)
has_cached_credentials(self)
authorize(self, http)
CookiesAuthenticatorMockFactory(hosts_with_creds=None, same_auth=False)
CookiesAuthenticatorMockFactory({'host': ('user', _, 'pass')
CookiesAuthenticatorMock(git_cl.gerrit_util.CookiesAuthenticator)
__init__(self)
super()
get_gitcookies_path(cls)
get_netrc_path(cls)
_get_auth_for_host(self, host)
return (hosts_with_creds or {})
get(host)
MockChangelistWithBranchAndIssue()
__init__(self, branch, issue)
GetBranch(self)
GetIssue(self)
SystemExitMock(Exception)
TestGitClBasic(unittest.TestCase)
test_get_description(self)
self.assertEquals(cl.GetDescription()
self.assertEquals(cl.GetDescription(force=True)
self.assertEquals(cl.GetDescription()
test_description_footers(self)
cl.GetDescriptionFooters()
self.assertEquals(footers, [('Some', 'Really')
msg.append('wut')
footers.append(('gnarly-dude', 'beans')
cl.UpdateDescriptionFooters(msg, footers)
self.assertEquals(cl.GetDescription()
splitlines()
test_get_bug_line_values(self)
list(git_cl._get_bug_line_values(p, bugs)
self.assertEqual(f('', '')
self.assertEqual(f('', '123,v8:456')
self.assertEqual(f('v8', '456')
self.assertEqual(f('v8', 'chromium:123,456')
self.assertEqual(f('v8', 'chromium:123,456,v8:123')
git_cl.ChangeDescription(child_msg)
desc.update_with_git_number_footers(parent_hash, parent_msg, dest_ref)
assertEqualByLine(self, actual, expected)
self.assertEqual(actual.splitlines()
expected.splitlines()
test_git_number_bad_parent(self)
self.assertRaises(ValueError)
self._test_git_number('Parent', 'refs/heads/master', 'Child')
test_git_number_bad_parent_footer(self)
self.assertRaises(AssertionError)
test_git_number_bad_lineage_ignored(self)
test_git_number_same_branch(self)
test_git_number_same_branch_mixed_footers(self)
test_git_number_same_branch_with_originals(self)
test_git_number_new_branch(self)
test_git_number_lineage(self)
test_git_number_moooooooore_lineage(self)
test_git_number_ever_moooooooore_lineage(self)
test_git_number_cherry_pick(self)
test_gerrit_mirror_hack(self)
git_cl.gerrit_util._UseGerritMirror(url0, cr)
git_cl.gerrit_util._UseGerritMirror(url1, cr)
git_cl.gerrit_util._UseGerritMirror(url2, cr)
self.assertNotEqual(url1, url2)
self.assertEqual(sorted((url1, url2)
self.assertEqual(url1, url3)
test_valid_accounts(self)
git_cl.gerrit_util.GerritError(500, 'retries didn\'t help :(')
GetAccountDetailsMock(_, account)
mock_per_account.pop(account)
isinstance(v, Exception)
TestParseIssueURL(unittest.TestCase)
self.assertIsNotNone(parsed)
self.assertFalse(parsed.valid)
self.assertTrue(parsed.valid)
self.assertEqual(parsed.issue, issue)
self.assertEqual(parsed.patchset, patchset)
self.assertEqual(parsed.hostname, hostname)
self.assertEqual(parsed.codereview, codereview)
_run_and_validate(self, func, url, *args, **kwargs)
func(urlparse.urlparse(url)
kwargs.pop('fail', False)
self.assertIsNone(result)
self._validate(result, *args, fail=False, **kwargs)
test_gerrit(self)
test(url, issue=None, patchset=None, hostname=None, fail=None)
test(url, *args, **kwargs)
test('https://chrome-review.source.com/c/123/1/whatisthis', fail=True)
test('https://chrome-review.source.com/c/abc/', fail=True)
test('ssh://chrome-review.source.com/c/123/1/', fail=True)
test_ParseIssueNumberArgument(self)
test(arg, *args, **kwargs)
kwargs.pop('hint', None)