Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: infra/libs/git2/test/ref_test.py

Issue 477623003: Add git subtree daemon service. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@add_dtree_support
Patch Set: address comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « infra/libs/git2/repo.py ('k') | infra/services/gsubtreed/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from infra.libs import git2 5 from infra.libs import git2
6 from infra.libs.git2.test import test_util 6 from infra.libs.git2.test import test_util
7 7
8 8
9 class TestRef(test_util.TestBasis): 9 class TestRef(test_util.TestBasis):
10 def testComparison(self): 10 def testComparison(self):
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 list(c.hsh for c in dne.to(O)), 54 list(c.hsh for c in dne.to(O)),
55 [self.repo[c] for c in 'ABCDLMNO'] 55 [self.repo[c] for c in 'ABCDLMNO']
56 ) 56 )
57 57
58 def testUpdateTo(self): 58 def testUpdateTo(self):
59 r = self.mkRepo() 59 r = self.mkRepo()
60 O = r['refs/heads/branch_O'] 60 O = r['refs/heads/branch_O']
61 S = r.get_commit(self.repo['S']) 61 S = r.get_commit(self.repo['S'])
62 self.capture_stdio(O.update_to, S) 62 self.capture_stdio(O.update_to, S)
63 self.assertEqual(O.commit.hsh, self.repo['S']) 63 self.assertEqual(O.commit.hsh, self.repo['S'])
64
65 def testHash(self):
66 # ensure that Ref's can be used as keys in a dict
67 r = self.mkRepo()
68 mapping = {}
69 mapping[r['refs/heads/branch_O']] = True
70 mapping[r['refs/heads/branch_O']] = True
71 self.assertEqual(len(mapping), 1)
OLDNEW
« no previous file with comments | « infra/libs/git2/repo.py ('k') | infra/services/gsubtreed/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698