Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test_walk: Simplify commit_time attr assignment.

Change-Id: I5818da44121a89eec590e52b8b0053d839e4713a
  • Loading branch information...
commit b47fa4eec8df1e2aaa5b2efe5b1e2f2c7c8746b5 1 parent 9fbcb3d
@dborowitz authored jelmer committed
Showing with 8 additions and 4 deletions.
  1. +8 −4 dulwich/tests/test_walk.py
View
12 dulwich/tests/test_walk.py
@@ -72,7 +72,12 @@ def setUp(self):
self.store = MemoryObjectStore()
def make_commits(self, commit_spec, **kwargs):
- return build_commit_graph(self.store, commit_spec, **kwargs)
+ times = kwargs.pop('times', [])
+ attrs = kwargs.pop('attrs', {})
+ for i, t in enumerate(times):
+ attrs.setdefault(i + 1, {})['commit_time'] = t
+ return build_commit_graph(self.store, commit_spec, attrs=attrs,
+ **kwargs)
def make_linear_commits(self, num_commits, **kwargs):
commit_spec = []
@@ -330,9 +335,8 @@ def test_since_until(self):
self.assertWalkYields([c2], [c3.id], since=50, until=150)
def test_since_over_scan(self):
- times = [9, 0, 1, 2, 3, 4, 5, 8, 6, 7, 9]
- attrs = dict((i + 1, {'commit_time': t}) for i, t in enumerate(times))
- commits = self.make_linear_commits(11, attrs=attrs)
+ commits = self.make_linear_commits(
+ 11, times=[9, 0, 1, 2, 3, 4, 5, 8, 6, 7, 9])
c8, _, c10, c11 = commits[-4:]
del self.store[commits[0].id]
# c9 is older than we want to walk, but is out of order with its parent,
Please sign in to comment.
Something went wrong with that request. Please try again.