~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/test_fetch_ghosts.py

  • Committer: Aaron Bentley
  • Date: 2006-06-13 02:31:28 UTC
  • mfrom: (0.1.119 shelf)
  • Revision ID: aaron.bentley@utoronto.ca-20060613023128-20f2ff3a212a6ea2
Pull in latest shelf stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from bzrlib.plugins.bzrtools.fetch_ghosts import GhostFetcher
2
 
from bzrlib.tests import TestCaseWithTransport
3
 
 
4
 
 
5
 
class TestFetchGhosts(TestCaseWithTransport):
6
 
 
7
 
    def prepare_with_ghosts(self):
8
 
        tree = self.make_branch_and_tree('.')
9
 
        tree.commit('rev1', rev_id='rev1-id')
10
 
        tree.set_parent_ids(['rev1-id', 'ghost-id'])
11
 
        tree.commit('rev2')
12
 
        return tree
13
 
 
14
 
    def test_fetch_ghosts_failure(self):
15
 
        tree = self.prepare_with_ghosts()
16
 
        branch = self.make_branch('branch')
17
 
        GhostFetcher(tree.branch, branch).run()
18
 
        self.assertFalse(tree.branch.repository.has_revision('ghost-id'))
19
 
 
20
 
    def test_fetch_ghosts_success(self):
21
 
        tree = self.prepare_with_ghosts()
22
 
        ghost_tree = self.make_branch_and_tree('ghost_tree')
23
 
        ghost_tree.commit('ghost', rev_id='ghost-id')
24
 
        GhostFetcher(tree.branch, ghost_tree.branch).run()
25
 
        self.assertTrue(tree.branch.repository.has_revision('ghost-id'))