~abentley/thekraken/1.1

« back to all changes in this revision

Viewing changes to tests/__init__.py

  • Committer: Aaron Bentley
  • Date: 2010-12-03 00:55:12 UTC
  • Revision ID: aaron@aaronbentley.com-20101203005512-i8c03kkhomn6ybwz
ImplementĀ pumpĀ --reprocess.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        self.connect_many(foo, bar, baz, qux, quxx)
31
31
        return [foo, bar, baz, qux, quxx]
32
32
 
33
 
    def create_conflict_pipeline(self):
 
33
    def create_conflict_pipeline(self, base=None, other=None, this=None):
 
34
        if base is None:
 
35
            base = 'base text\n'
 
36
        if other is None:
 
37
            other = 'merge text\n'
 
38
        if this is None:
 
39
            this = 'tree text\n'
34
40
        foo = self.make_branch_and_checkout('foo')
35
 
        self.build_tree_contents([('checkout/foo', 'base text\n')])
 
41
        self.build_tree_contents([('checkout/foo', base)])
36
42
        foo.add('foo')
37
43
        foo.commit('added foo')
38
44
        foo_manager = PipeManager(foo.branch, foo)
40
46
        first = foo.branch
41
47
        foo_manager.switch_to_pipe(last)
42
48
        foo = foo_manager._refresh_tree(foo)
43
 
        self.build_tree_contents([('checkout/foo', 'tree text\n')])
 
49
        self.build_tree_contents([('checkout/foo', this)])
44
50
        foo.commit('commiting this text')
45
51
        foo_manager.switch_to_pipe(first)
46
52
        foo = foo_manager._refresh_tree(foo)
47
 
        self.build_tree_contents([('checkout/foo', 'merge text\n')])
 
53
        self.build_tree_contents([('checkout/foo', other)])
48
54
        foo.commit('commiting other text')
49
55
        return foo